This commit is contained in:
Alexey Kulish 2016-11-21 17:15:36 +03:00
parent 5bc6cb9ad9
commit 53434d7527
4 changed files with 31 additions and 13 deletions

View file

@ -10,6 +10,11 @@
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="legacy_search">Legacy search</string>
<string name="show_legacy_search">Show legacy search</string>
<string name="show_legacy_search_desc">Enable legacy search in the drawer list</string>
<string name="routing_attr_allow_motorway_name">Allow motorways</string>
<string name="routing_attr_allow_motorway_description">Allow motorways</string>
<string name="upload_osm_note_description">You can upload your OSM Note anonymously or using your OpenStreetMap.org profile.</string>
<string name="wiki_around">Nearby Wikipedia articles</string>
<string name="search_map_hint">Search city or region</string>

View file

@ -1120,6 +1120,8 @@ public class OsmandSettings {
public final OsmandPreference<Boolean> NO_DISCOUNT_INFO = new BooleanPreference("no_discount_info", false).makeGlobal();
public final OsmandPreference<Boolean> SHOW_LEGACY_SEARCH = new BooleanPreference("show_legacy_search", false).makeGlobal();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference<Boolean> DEBUG_RENDERING_INFO = new BooleanPreference("debug_rendering", false).makeGlobal();

View file

@ -628,7 +628,16 @@ public class MapActivityActions implements DialogProvider {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.NEW_IF_EXPIRED, false);
/*
return true;
}
}).createItem());
if (settings.SHOW_LEGACY_SEARCH.get()) {
optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.legacy_search, mapActivity)
.setIcon(R.drawable.ic_action_search_dark)
.setListener(new ContextMenuAdapter.ItemClickListener() {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getSearchActivity());
LatLon loc = mapActivity.getMapLocation();
@ -639,10 +648,10 @@ public class MapActivityActions implements DialogProvider {
}
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
mapActivity.startActivity(newIntent);
*/
return true;
}
}).createItem());
}
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.configure_map, mapActivity)
.setIcon(R.drawable.ic_action_layers_dark)

View file

@ -86,6 +86,8 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
cat.addPreference(createCheckBoxPreference(settings.NO_DISCOUNT_INFO,
R.string.no_update_info, R.string.no_update_info_desc));
cat.addPreference(createCheckBoxPreference(settings.SHOW_LEGACY_SEARCH,
R.string.show_legacy_search, R.string.show_legacy_search_desc));
// FIXME delete USE_MAP_MARKERS
// cat.addPreference(createCheckBoxPreference(settings.USE_MAP_MARKERS,