Search in sources :

Example 1 with AppInitializeListener

use of net.osmand.plus.AppInitializer.AppInitializeListener in project Osmand by osmandapp.

the class QuickSearchDialogFragment method runCoreSearch.

private void runCoreSearch(final String text, final boolean showQuickResult, final boolean searchMore, final SearchResultListener resultListener) {
    showProgressBar();
    foundPartialLocation = false;
    updateToolbarButton();
    interruptedSearch = false;
    searching = true;
    cancelPrev = true;
    if (app.isApplicationInitializing() && text.length() > 0) {
        app.getAppInitializer().addListener(new AppInitializeListener() {

            @Override
            public void onProgress(AppInitializer init, AppInitializer.InitEvents event) {
            }

            @Override
            public void onFinish(AppInitializer init) {
                if (!paused) {
                    runCoreSearchInternal(text, showQuickResult, searchMore, resultListener);
                }
            }
        });
    } else {
        runCoreSearchInternal(text, showQuickResult, searchMore, resultListener);
    }
}
Also used : AppInitializer(net.osmand.plus.AppInitializer) AppInitializeListener(net.osmand.plus.AppInitializer.AppInitializeListener)

Example 2 with AppInitializeListener

use of net.osmand.plus.AppInitializer.AppInitializeListener in project Osmand by osmandapp.

the class QuickSearchDialogFragment method reloadCities.

public void reloadCities() {
    if (app.isApplicationInitializing()) {
        showProgressBar();
        app.getAppInitializer().addListener(new AppInitializeListener() {

            @Override
            public void onProgress(AppInitializer init, AppInitializer.InitEvents event) {
            }

            @Override
            public void onFinish(AppInitializer init) {
                if (!paused) {
                    reloadCitiesInternal();
                    if (!searching) {
                        hideProgressBar();
                    }
                }
            }
        });
    } else {
        reloadCitiesInternal();
    }
}
Also used : AppInitializer(net.osmand.plus.AppInitializer) AppInitializeListener(net.osmand.plus.AppInitializer.AppInitializeListener)

Example 3 with AppInitializeListener

use of net.osmand.plus.AppInitializer.AppInitializeListener in project Osmand by osmandapp.

the class QuickSearchDialogFragment method reloadCategories.

public void reloadCategories() {
    if (app.isApplicationInitializing()) {
        showProgressBar();
        app.getAppInitializer().addListener(new AppInitializeListener() {

            @Override
            public void onProgress(AppInitializer init, AppInitializer.InitEvents event) {
            }

            @Override
            public void onFinish(AppInitializer init) {
                if (!paused) {
                    reloadCategoriesInternal();
                    if (!searching) {
                        hideProgressBar();
                    }
                }
            }
        });
    } else {
        reloadCategoriesInternal();
    }
}
Also used : AppInitializer(net.osmand.plus.AppInitializer) AppInitializeListener(net.osmand.plus.AppInitializer.AppInitializeListener)

Example 4 with AppInitializeListener

use of net.osmand.plus.AppInitializer.AppInitializeListener in project Osmand by osmandapp.

the class QuickSearchDialogFragment method reloadHistory.

public void reloadHistory() {
    if (app.isApplicationInitializing()) {
        showProgressBar();
        app.getAppInitializer().addListener(new AppInitializeListener() {

            @Override
            public void onProgress(AppInitializer init, AppInitializer.InitEvents event) {
            }

            @Override
            public void onFinish(AppInitializer init) {
                if (!paused) {
                    reloadHistoryInternal();
                    if (!searching) {
                        hideProgressBar();
                    }
                }
            }
        });
    } else {
        reloadHistoryInternal();
    }
}
Also used : AppInitializer(net.osmand.plus.AppInitializer) AppInitializeListener(net.osmand.plus.AppInitializer.AppInitializeListener)

Example 5 with AppInitializeListener

use of net.osmand.plus.AppInitializer.AppInitializeListener in project Osmand by osmandapp.

the class GeoIntentActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.search_address_offline);
    getSupportActionBar().setTitle(R.string.search_osm_offline);
    getMyApplication().checkApplicationIsBeingInitialized(this, new AppInitializeListener() {

        @Override
        public void onProgress(AppInitializer init, InitEvents event) {
        }

        @Override
        public void onFinish(AppInitializer init) {
        }
    });
    location = getMyApplication().getSettings().getLastKnownMapLocation();
    final Intent intent = getIntent();
    if (intent != null) {
        final ProgressDialog progress = ProgressDialog.show(GeoIntentActivity.this, getString(R.string.searching), getString(R.string.searching_address));
        final GeoIntentTask task = new GeoIntentTask(progress, intent);
        progress.setOnCancelListener(new OnCancelListener() {

            @Override
            public void onCancel(DialogInterface dialog) {
                task.cancel(true);
            }
        });
        progress.setCancelable(true);
        task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        setIntent(null);
    }
}
Also used : AppInitializer(net.osmand.plus.AppInitializer) DialogInterface(android.content.DialogInterface) Intent(android.content.Intent) AppInitializeListener(net.osmand.plus.AppInitializer.AppInitializeListener) ProgressDialog(android.app.ProgressDialog) InitEvents(net.osmand.plus.AppInitializer.InitEvents) OnCancelListener(android.content.DialogInterface.OnCancelListener)

Aggregations

AppInitializer (net.osmand.plus.AppInitializer)6 AppInitializeListener (net.osmand.plus.AppInitializer.AppInitializeListener)6 InitEvents (net.osmand.plus.AppInitializer.InitEvents)2 ProgressDialog (android.app.ProgressDialog)1 DialogInterface (android.content.DialogInterface)1 OnCancelListener (android.content.DialogInterface.OnCancelListener)1 Intent (android.content.Intent)1