Delete legacy search as used less than 0.1% people and non-maintainable any more

This commit is contained in:
Victor Shcherb 2018-09-29 21:16:56 +02:00
parent 186ba55188
commit 0ae307dbf6
6 changed files with 1 additions and 49 deletions

View file

@ -529,8 +529,6 @@
<string name="rendering_attr_hideWaterPolygons_description">Water</string>
<string name="rendering_attr_hideWaterPolygons_name">Hide water</string>
<string name="legacy_search">Legacy search</string>
<string name="show_legacy_search">Show legacy search</string>
<string name="show_legacy_search_desc">Add the legacy search to 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">Upload your OSM Note anonymously or by using your OpenStreetMap.org profile.</string>

View file

@ -56,10 +56,6 @@ public class OsmAndAppCustomization {
return MapActivity.class;
}
public Class<SearchActivity> getSearchActivity(){
return SearchActivity.class;
}
public Class<TrackActivity> getTrackActivity(){
return TrackActivity.class;
}

View file

@ -1192,9 +1192,6 @@ public class OsmandSettings {
}
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

@ -1367,19 +1367,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
uiHandler.sendMessageDelayed(msg, LONG_KEYPRESS_DELAY);
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
Intent newIntent = new Intent(MapActivity.this, getMyApplication().getAppCustomization()
.getSearchActivity());
// causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
LatLon loc = getMapLocation();
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
if (mapViewTrackingUtilities.isMapLinkedToLocation()) {
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
}
startActivity(newIntent);
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
return true;
}
return super.onKeyDown(keyCode, event);
}

View file

@ -696,28 +696,7 @@ public class MapActivityActions implements DialogProvider {
}
}).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, int[] viewCoordinates) {
app.logEvent(mapActivity, "drawer_legacy_search_open");
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization()
.getSearchActivity());
LatLon loc = mapActivity.getMapLocation();
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
if (mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation()) {
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
}
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
mapActivity.startActivity(newIntent);
return true;
}
}).createItem());
}
optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.get_directions, mapActivity)
.setIcon(R.drawable.ic_action_gdirections_dark)
.setListener(new ContextMenuAdapter.ItemClickListener() {

View file

@ -88,11 +88,6 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
R.string.show_free_version_banner,
R.string.show_free_version_banner_description));
cat.addPreference(createCheckBoxPreference(settings.SHOW_LEGACY_SEARCH,
R.string.show_legacy_search, R.string.show_legacy_search_desc));
Preference pref = new Preference(this);
final Preference simulate = pref;
final OsmAndLocationSimulation sim = getMyApplication().getLocationProvider().getLocationSimulation();