renamed executeWithParams params

This commit is contained in:
Chumva 2018-06-06 15:53:20 +03:00
parent fe478b7427
commit 988b916ddb
5 changed files with 21 additions and 21 deletions

View file

@ -105,7 +105,7 @@ public abstract class SwitchableAction<T> extends QuickAction {
public abstract List<T> loadListFromParams();
public abstract void executeWithParams(MapActivity mapActivity, String params);
public abstract void executeWithParams(MapActivity activity, String params);
protected void showChooseDialog(FragmentManager fm) {
SelectMapViewQuickActionsBottomSheet fragment = new SelectMapViewQuickActionsBottomSheet();

View file

@ -104,10 +104,10 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
}
@Override
public void executeWithParams(MapActivity mapActivity, String params) {
public void executeWithParams(MapActivity activity, String params) {
OsmandRasterMapsPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class);
if (plugin != null) {
OsmandSettings settings = mapActivity.getMyApplication().getSettings();
OsmandSettings settings = activity.getMyApplication().getSettings();
boolean hasOverlay = !params.equals(KEY_NO_OVERLAY);
if (hasOverlay) {
settings.MAP_OVERLAY.set(params);
@ -116,8 +116,8 @@ public class MapOverlayAction extends SwitchableAction<Pair<String, String>> {
settings.MAP_OVERLAY.set(null);
settings.MAP_OVERLAY_PREVIOUS.set(null);
}
plugin.updateMapLayers(mapActivity.getMapView(), settings.MAP_OVERLAY, mapActivity.getMapLayers());
Toast.makeText(mapActivity, mapActivity.getString(R.string.quick_action_map_overlay_switch, params), Toast.LENGTH_SHORT).show();
plugin.updateMapLayers(activity.getMapView(), settings.MAP_OVERLAY, activity.getMapLayers());
Toast.makeText(activity, activity.getString(R.string.quick_action_map_overlay_switch, params), Toast.LENGTH_SHORT).show();
}
}

View file

@ -98,17 +98,17 @@ public class MapSourceAction extends SwitchableAction<Pair<String, String>> {
}
@Override
public void executeWithParams(MapActivity mapActivity, String params) {
OsmandSettings settings = mapActivity.getMyApplication().getSettings();
public void executeWithParams(MapActivity activity, String params) {
OsmandSettings settings = activity.getMyApplication().getSettings();
if (params.equals(LAYER_OSM_VECTOR)) {
settings.MAP_ONLINE_DATA.set(false);
mapActivity.getMapLayers().updateMapSource(mapActivity.getMapView(), null);
activity.getMapLayers().updateMapSource(activity.getMapView(), null);
} else {
settings.MAP_TILE_SOURCES.set(params);
settings.MAP_ONLINE_DATA.set(true);
mapActivity.getMapLayers().updateMapSource(mapActivity.getMapView(), settings.MAP_TILE_SOURCES);
activity.getMapLayers().updateMapSource(activity.getMapView(), settings.MAP_TILE_SOURCES);
}
Toast.makeText(mapActivity, mapActivity.getString(R.string.quick_action_map_source_switch, params), Toast.LENGTH_SHORT).show();
Toast.makeText(activity, activity.getString(R.string.quick_action_map_source_switch, params), Toast.LENGTH_SHORT).show();
}
@Override

View file

@ -59,19 +59,19 @@ public class MapStyleAction extends SwitchableAction<String> {
}
@Override
public void executeWithParams(MapActivity mapActivity, String params) {
OsmandApplication app = mapActivity.getMyApplication();
public void executeWithParams(MapActivity activity, String params) {
OsmandApplication app = activity.getMyApplication();
RenderingRulesStorage loaded = app.getRendererRegistry().getRenderer(params);
if (loaded != null) {
OsmandMapTileView view = mapActivity.getMapView();
OsmandMapTileView view = activity.getMapView();
view.getSettings().RENDERER.set(params);
app.getRendererRegistry().setCurrentSelectedRender(loaded);
ConfigureMapMenu.refreshMapComplete(mapActivity);
ConfigureMapMenu.refreshMapComplete(activity);
Toast.makeText(mapActivity, mapActivity.getString(R.string.quick_action_map_style_switch, params), Toast.LENGTH_SHORT).show();
Toast.makeText(activity, activity.getString(R.string.quick_action_map_style_switch, params), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mapActivity, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show();
Toast.makeText(activity, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show();
}
}

View file

@ -103,10 +103,10 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
}
@Override
public void executeWithParams(MapActivity mapActivity, String params) {
public void executeWithParams(MapActivity activity, String params) {
OsmandRasterMapsPlugin plugin = OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class);
if (plugin != null) {
OsmandSettings settings = mapActivity.getMyApplication().getSettings();
OsmandSettings settings = activity.getMyApplication().getSettings();
boolean hasUnderlay = !params.equals(KEY_NO_UNDERLAY);
if (hasUnderlay) {
settings.MAP_UNDERLAY.set(params);
@ -116,11 +116,11 @@ public class MapUnderlayAction extends SwitchableAction<Pair<String, String>> {
settings.MAP_UNDERLAY_PREVIOUS.set(null);
}
final OsmandSettings.CommonPreference<Boolean> hidePolygonsPref =
mapActivity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");
activity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");
hidePolygonsPref.set(hasUnderlay);
plugin.updateMapLayers(mapActivity.getMapView(), settings.MAP_UNDERLAY, mapActivity.getMapLayers());
Toast.makeText(mapActivity, mapActivity.getString(R.string.quick_action_map_underlay_switch, params), Toast.LENGTH_SHORT).show();
plugin.updateMapLayers(activity.getMapView(), settings.MAP_UNDERLAY, activity.getMapLayers());
Toast.makeText(activity, activity.getString(R.string.quick_action_map_underlay_switch, params), Toast.LENGTH_SHORT).show();
}
}