Fix #9623 part 4 (remove tautology)

This commit is contained in:
Nazar-Kutz 2020-09-24 11:29:49 +03:00
parent 7534f8b28b
commit b8a1032295
4 changed files with 8 additions and 8 deletions

View file

@ -715,7 +715,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
cm = mapActivity.getMapLayers().getMapWidgetRegistry().getViewConfigureMenuAdapter(mapActivity);
} else if (visibleType == DashboardType.CONFIGURE_MAP) {
configureMapMenu = new ConfigureMapMenu(mapActivity);
cm = configureMapMenu.createListAdapter(mapActivity);
cm = configureMapMenu.createListAdapter();
} else if (visibleType == DashboardType.LIST_MENU) {
cm = mapActivity.getMapActions().createMainOptionsMenu();
} else if (visibleType == DashboardType.ROUTE_PREFERENCES) {

View file

@ -110,7 +110,7 @@ public class ConfigureMapMenu {
private int selectedLanguageIndex;
private boolean transliterateNames;
private MapActivity mapActivity;
private MapActivity ma;
private ContextMenuAdapter contextMenuAdapter;
public interface OnClickListener {
@ -118,10 +118,10 @@ public class ConfigureMapMenu {
}
public ConfigureMapMenu(MapActivity mapActivity) {
this.mapActivity = mapActivity;
this.ma = mapActivity;
}
public ContextMenuAdapter createListAdapter(final MapActivity ma) {
public ContextMenuAdapter createListAdapter() {
OsmandApplication app = ma.getMyApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
@ -134,7 +134,7 @@ public class ConfigureMapMenu {
adapter.setChangeAppModeListener(new OnClickListener() {
@Override
public void onClick() {
ma.getDashboard().updateListAdapter(createListAdapter(ma));
ma.getDashboard().updateListAdapter(createListAdapter());
}
});
List<RenderingRuleProperty> customRules = getCustomRules(app,
@ -1132,7 +1132,7 @@ public class ConfigureMapMenu {
}
private OsmandApplication getMyApplication() {
return mapActivity.getMyApplication();
return ma.getMyApplication();
}
private static class StringSpinnerArrayAdapter extends ArrayAdapter<String> {

View file

@ -198,7 +198,7 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment
break;
case CONFIGURE_MAP:
ConfigureMapMenu configureMapMenu = new ConfigureMapMenu((MapActivity) activity);
contextMenuAdapter = configureMapMenu.createListAdapter((MapActivity) activity);
contextMenuAdapter = configureMapMenu.createListAdapter();
break;
case CONTEXT_MENU_ACTIONS:
MapContextMenu menu = ((MapActivity) activity).getContextMenu();

View file

@ -286,7 +286,7 @@ public class ConfigureMenuRootFragment extends BaseOsmAndFragment {
break;
case CONFIGURE_MAP:
ConfigureMapMenu configureMapMenu = new ConfigureMapMenu((MapActivity) activity);
contextMenuAdapter = configureMapMenu.createListAdapter((MapActivity) activity);
contextMenuAdapter = configureMapMenu.createListAdapter();
break;
case CONTEXT_MENU_ACTIONS:
MapContextMenu menu = ((MapActivity) activity).getContextMenu();