src/main/java/de/blau/android/easyedit/EasyEditActionModeCallback.java
/**
     * Split ways after checking that we have all neighbouring relevant relation members
     * 
     * @param ways the List of Ways we will split
     * @param runnable run this once we've downloaded any missing ways or otherwise can continue
     */
Split ways after checking that we have all neighbouring relevant relation members

@param ways the List of Ways we will split
@param runnable run this once we've downloaded any missing ways or otherwise can continue
Split ways after checking that we have all neighbouring relevant relation members @param ways the List of Ways we will split @param runnable run this once we ' ve downloaded any missing ways or otherwise can continue
protected void splitSafe(@NonNull List<Way> ways, @NonNull Runnable runnable) {
        List<Long> missing = new ArrayList<>();
        for (Way way : ways) {
            missing.addAll(RelationUtils.checkForNeighbours(way));
        }
        if (!missing.isEmpty() && main.isConnectedOrConnecting()) {
            Builder builder = new AlertDialog.Builder(main);
            builder.setTitle(R.string.split_safe_title);
            builder.setMessage(R.string.split_safe_message);
            builder.setPositiveButton(R.string.download,
                    (DialogInterface dialog, int which) -> logic.downloadElements(main, null, missing, null, new PostAsyncActionHandler() {
                        @Override
                        public void onSuccess() {
                            runnable.run();
                        }
                        @Override
                        public void onError(@Nullable AsyncResult result) {
                            ErrorAlert.showDialog(main, result);
                        }
                    }));
            builder.setNegativeButton(R.string.ignore, (DialogInterface dialog, int which) -> runnable.run());
            builder.setNeutralButton(R.string.abort, (DialogInterface dialog, int which) -> manager.finish());
            builder.show();
        } else {
            runnable.run();
        }
    }
protected void splitSafe ( @ NonNull List < Way > ways , @ NonNull Runnable runnable ) { List < Long > missing = new ArrayList < > ( ) ; for ( Way way : ways ) { missing . addAll ( RelationUtils . checkForNeighbours ( way ) ) ; } if ( ! missing . isEmpty ( ) && main . isConnectedOrConnecting ( ) ) { Builder builder = new AlertDialog . Builder ( main ) ; builder . setTitle ( R . string . split_safe_title ) ; builder . setMessage ( R . string . split_safe_message ) ; builder . setPositiveButton ( R . string . download , ( DialogInterface dialog , int which ) -> logic . downloadElements ( main , null , missing , null , new PostAsyncActionHandler ( ) { @ Override public void onSuccess ( ) { runnable . run ( ) ; } @ Override public void onError ( @ Nullable AsyncResult result ) { ErrorAlert . showDialog ( main , result ) ; } } ) ) ; builder . setNegativeButton ( R . string . ignore , ( DialogInterface dialog , int which ) -> runnable . run ( ) ) ; builder . setNeutralButton ( R . string . abort , ( DialogInterface dialog , int which ) -> manager . finish ( ) ) ; builder . show ( ) ; } else { runnable . run ( ) ; } }
Split ways after checking that we have all neighbouring relevant relation members
Split ways after checking that we have all neighbouring relevant relation members