Map widgets visibility refactoring, part 3
This commit is contained in:
parent
3dff56da46
commit
5149d6543b
1 changed files with 13 additions and 13 deletions
|
@ -856,27 +856,27 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
RoutingHelper rh = mapActivity.getRoutingHelper();
|
RoutingHelper rh = mapActivity.getRoutingHelper();
|
||||||
WidgetsVisibilityHelper vh = mapActivity.getWidgetsVisibilityHelper();
|
WidgetsVisibilityHelper vh = mapActivity.getWidgetsVisibilityHelper();
|
||||||
|
|
||||||
boolean routePlanningMode = isInRoutePlanningMode();
|
boolean isRoutePlanningMode = isInRoutePlanningMode();
|
||||||
boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
|
boolean isRouteFollowingMode = !isRoutePlanningMode && rh.isFollowingMode();
|
||||||
boolean timeToShowButtons = System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS;
|
boolean isTimeToShowButtons = System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS;
|
||||||
boolean showRouteCalculationControls = routePlanningMode || ((app.accessibilityEnabled() || timeToShowButtons) && routeFollowingMode);
|
boolean shouldShowRouteCalculationControls = isRoutePlanningMode || ((app.accessibilityEnabled() || isTimeToShowButtons) && isRouteFollowingMode);
|
||||||
boolean routeDialogOpened = mapRouteInfoMenu.isVisible() || (showRouteCalculationControls && mapRouteInfoMenu.needShowMenu());
|
boolean isRouteDialogOpened = mapRouteInfoMenu.isVisible() || (shouldShowRouteCalculationControls && mapRouteInfoMenu.needShowMenu());
|
||||||
|
|
||||||
boolean showBackToLocation = !routeDialogOpened && mapActivity.getWidgetsVisibilityHelper().shouldShowBackToLocationButton();
|
boolean showBackToLocation = !isRouteDialogOpened && vh.shouldShowBackToLocationButton();
|
||||||
backToLocationControl.updateVisibility(showBackToLocation);
|
backToLocationControl.updateVisibility(showBackToLocation);
|
||||||
|
|
||||||
//routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_info_dark : R.drawable.ic_action_gdirections_dark);
|
//routePlanningBtn.setIconResId(isRouteFollowingMode ? R.drawable.ic_action_info_dark : R.drawable.ic_action_gdirections_dark);
|
||||||
updateRoutePlaningButton(rh, routePlanningMode);
|
updateRoutePlaningButton(rh, isRoutePlanningMode);
|
||||||
|
|
||||||
boolean showBottomMenuButtons = (showRouteCalculationControls || !routeFollowingMode) && vh.shouldShowBottomMenuButtons();
|
boolean showBottomMenuButtons = (shouldShowRouteCalculationControls || !isRouteFollowingMode) && vh.shouldShowBottomMenuButtons();
|
||||||
routePlanningBtn.updateVisibility(showBottomMenuButtons);
|
routePlanningBtn.updateVisibility(showBottomMenuButtons);
|
||||||
menuControl.updateVisibility(showBottomMenuButtons);
|
menuControl.updateVisibility(showBottomMenuButtons);
|
||||||
|
|
||||||
boolean showZoomButtons = !routeDialogOpened && vh.shouldShowZoomButtons();
|
boolean showZoomButtons = !isRouteDialogOpened && vh.shouldShowZoomButtons();
|
||||||
mapZoomIn.updateVisibility(showZoomButtons);
|
mapZoomIn.updateVisibility(showZoomButtons);
|
||||||
mapZoomOut.updateVisibility(showZoomButtons);
|
mapZoomOut.updateVisibility(showZoomButtons);
|
||||||
|
|
||||||
boolean forceHideCompass = routeDialogOpened || vh.shouldHideCompass();
|
boolean forceHideCompass = isRouteDialogOpened || vh.shouldHideCompass();
|
||||||
compassHud.forceHideCompass = forceHideCompass;
|
compassHud.forceHideCompass = forceHideCompass;
|
||||||
compassHud.updateVisibility(!forceHideCompass && shouldShowCompass());
|
compassHud.updateVisibility(!forceHideCompass && shouldShowCompass());
|
||||||
|
|
||||||
|
@ -885,7 +885,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
if (layersHud.setIconResId(appMode.getIconRes())) {
|
if (layersHud.setIconResId(appMode.getIconRes())) {
|
||||||
layersHud.update(app, isNight);
|
layersHud.update(app, isNight);
|
||||||
}
|
}
|
||||||
boolean showTopButtons = !routeDialogOpened && vh.shouldShowTopButtons();
|
boolean showTopButtons = !isRouteDialogOpened && vh.shouldShowTopButtons();
|
||||||
layersHud.updateVisibility(showTopButtons);
|
layersHud.updateVisibility(showTopButtons);
|
||||||
quickSearchHud.updateVisibility(showTopButtons);
|
quickSearchHud.updateVisibility(showTopButtons);
|
||||||
|
|
||||||
|
@ -900,7 +900,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
zoomText.setText(getZoomLevel(tileBox));
|
zoomText.setText(getZoomLevel(tileBox));
|
||||||
}
|
}
|
||||||
|
|
||||||
mapRouteInfoMenu.setVisible(showRouteCalculationControls);
|
mapRouteInfoMenu.setVisible(shouldShowRouteCalculationControls);
|
||||||
if (!forceHideCompass) {
|
if (!forceHideCompass) {
|
||||||
updateCompass(isNight);
|
updateCompass(isNight);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue