This commit is contained in:
Chumva 2018-07-20 17:05:25 +03:00
parent 12748cb857
commit bc0bdcf99c

View file

@ -1135,18 +1135,21 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
for (SearchResult sr : res.getCurrentSearchResults()) { for (SearchResult sr : res.getCurrentSearchResults()) {
rows.add(new QuickSearchListItem(app, sr)); rows.add(new QuickSearchListItem(app, sr));
} }
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) { rows.add(new QuickSearchButtonListItem(app, R.drawable.ic_world_globe_dark,
rows.add(new QuickSearchButtonListItem(app, R.drawable.ic_world_globe_dark, app.getString(R.string.search_online_address), new OnClickListener() {
app.getString(R.string.search_online_address), new OnClickListener() { @Override
@Override public void onClick(View view) {
public void onClick(View view) { final OsmandSettings settings = app.getSettings();
startOnlineSearch(); if (!settings.isInternetConnectionAvailable()) {
mainSearchFragment.getAdapter().clear(); Toast.makeText(app, R.string.internet_not_available, Toast.LENGTH_LONG).show();
updateTabbarVisibility(false); return;
openKeyboard();
} }
})); startOnlineSearch();
} mainSearchFragment.getAdapter().clear();
updateTabbarVisibility(false);
openKeyboard();
}
}));
rows.add(new QuickSearchButtonListItem(app, R.drawable.ic_action_search_dark, rows.add(new QuickSearchButtonListItem(app, R.drawable.ic_action_search_dark,
app.getString(R.string.custom_search), new OnClickListener() { app.getString(R.string.custom_search), new OnClickListener() {
@Override @Override