Remove unnecessary changes and rename hideContextAndRouteInfoMenues

This commit is contained in:
Chumva 2019-04-08 15:12:29 +03:00
parent 544827430f
commit 550c8c5a50
5 changed files with 39 additions and 20 deletions

View file

@ -1345,19 +1345,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
OsmandPlugin.onMapActivityPause(this);
}
public void updateControlsVisibility(boolean visible, boolean openingRouteInfoDialog) {
int visibility = visible ? View.VISIBLE : View.GONE;
findViewById(R.id.map_center_info).setVisibility(visibility);
findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
if (!openingRouteInfoDialog) {
findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
if (isLandscapeLayout()) {
getMapView().setMapPositionX(visible ? 0 : 1);
}
}
refreshMap();
}
public void updateApplicationModeSettings() {
updateMapSettings();
mapViewTrackingUtilities.updateSettings();
@ -1619,7 +1606,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return trackDetailsMenu;
}
public void hideContextAndRouteInfoMenus() {
public void hideContextAndRouteInfoMenues() {
mapContextMenu.hideMenues();
mapRouteInfoMenu.hide();
}

View file

@ -889,7 +889,7 @@ public class MapActivityActions implements DialogProvider {
}
public void openIntermediatePointsDialog() {
mapActivity.hideContextAndRouteInfoMenus();
mapActivity.hideContextAndRouteInfoMenues();
WaypointsFragment.showInstance(mapActivity.getSupportFragmentManager());
}

View file

@ -206,7 +206,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (!wasDrawerDisabled) {
mapActivity.disableDrawer();
}
mapActivity.updateControlsVisibility(false, false);
updateControlsVisibility(false, false);
}
}
@ -218,7 +218,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
if (!wasDrawerDisabled) {
mapActivity.enableDrawer();
}
mapActivity.updateControlsVisibility(true, routeInfoMenuState != -1);
updateControlsVisibility(true, routeInfoMenuState != -1);
}
}
@ -763,6 +763,22 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
}
}
public void updateControlsVisibility(boolean visible, boolean openingRouteInfo) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
if (!openingRouteInfo) {
mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
if (!portrait) {
mapActivity.getMapView().setMapPositionX(visible ? 0 : 1);
}
}
mapActivity.refreshMap();
}
}
@Override
public void onContextMenuYPosChanged(@NonNull ContextMenuFragment fragment, int y, boolean needMapAdjust, boolean animated) {
if (fragment == getCurrentFragment()) {

View file

@ -350,7 +350,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
mapActivity.disableDrawer();
}
updateRouteCalculationProgress(0);
mapActivity.updateControlsVisibility(false, false);
updateControlsVisibility(false, false);
}
}
@ -366,7 +366,7 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
if (!wasDrawerDisabled) {
mapActivity.enableDrawer();
}
mapActivity.updateControlsVisibility(true, routeInfoMenuState != -1);
updateControlsVisibility(true, routeInfoMenuState != -1);
}
}
@ -556,6 +556,22 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
return listAdapter;
}
public void updateControlsVisibility(boolean visible, boolean openingRouteInfo) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
int visibility = visible ? View.VISIBLE : View.GONE;
mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility);
mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility);
if (!openingRouteInfo) {
mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility);
if (!portrait) {
mapActivity.getMapView().setMapPositionX(visible ? 0 : 1);
}
}
mapActivity.refreshMap();
}
}
public void newRouteIsCalculated(boolean newRoute, ValueHolder<Boolean> showToast) {
reloadAdapter();
showToast.value = false;

View file

@ -1003,7 +1003,7 @@ public class MapInfoWidgetsFactory {
all.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
map.hideContextAndRouteInfoMenus();
map.hideContextAndRouteInfoMenues();
WaypointsFragment.showInstance(map.getSupportFragmentManager());
}
});