use of net.osmand.plus.AppInitializer 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);
}
}
use of net.osmand.plus.AppInitializer 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();
}
}
use of net.osmand.plus.AppInitializer 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();
}
}
use of net.osmand.plus.AppInitializer 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();
}
}
use of net.osmand.plus.AppInitializer 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);
}
}
Aggregations