From c7f5edca551a6487b35b88d005eaed96ec63f7f9 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 26 Jan 2021 17:59:47 +0200 Subject: [PATCH 1/4] Fix first map position adjusting --- .../osmand/plus/base/ContextMenuFragment.java | 7 ++++--- .../plus/base/ContextMenuScrollFragment.java | 2 +- .../ChooseRouteFragment.java | 2 +- .../osmand/plus/track/TrackMenuFragment.java | 19 +++++++------------ 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java index 4f6097897f..4cc90afd96 100644 --- a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java @@ -103,7 +103,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment public interface ContextMenuFragmentListener { void onContextMenuYPosChanged(@NonNull ContextMenuFragment fragment, int y, boolean needMapAdjust, boolean animated); - void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState); + void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState, int previousMenuState); void onContextMenuDismiss(@NonNull ContextMenuFragment fragment); } @@ -815,7 +815,7 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment ContextMenuFragmentListener listener = this.listener; if (listener != null) { - listener.onContextMenuStateChanged(this, newMenuState); + listener.onContextMenuStateChanged(this, newMenuState, currentMenuState); } } @@ -971,7 +971,8 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment ContextMenuFragmentListener listener = ContextMenuFragment.this.listener; if (listener != null) { - listener.onContextMenuStateChanged(ContextMenuFragment.this, getCurrentMenuState()); + int menuState = getCurrentMenuState(); + listener.onContextMenuStateChanged(ContextMenuFragment.this, menuState, menuState); } } } diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuScrollFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuScrollFragment.java index 51f4278948..5ba853e147 100644 --- a/OsmAnd/src/net/osmand/plus/base/ContextMenuScrollFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuScrollFragment.java @@ -82,7 +82,7 @@ public abstract class ContextMenuScrollFragment extends ContextMenuFragment impl } @Override - public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState) { + public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState, int previousMenuState) { updateMapControlsVisibility(menuState); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java index 5c283c670d..99d6a5c0cd 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java @@ -815,7 +815,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe } @Override - public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState) { + public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int menuState, int previousMenuState) { LockableViewPager viewPager = this.viewPager; RouteDetailsFragment current = getCurrentFragment(); if (viewPager != null && fragment == current) { diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java index 8bcfb411ef..0e21879f85 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java @@ -152,6 +152,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card private int menuTitleHeight; private int toolbarHeightPx; + private boolean mapPositionAdjusted; public enum TrackMenuType { OVERVIEW(R.id.action_overview, R.string.shared_string_overview), @@ -455,9 +456,11 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card } @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - adjustMapPosition(getHeight()); + public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int currentMenuState, int previousMenuState) { + super.onContextMenuStateChanged(fragment, currentMenuState, previousMenuState); + if (currentMenuState != MenuState.FULL_SCREEN && (currentMenuState != previousMenuState || !mapPositionAdjusted)) { + adjustMapPosition(getViewY()); + } } @Override @@ -760,15 +763,6 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card } } - @Override - protected int applyPosY(int currentY, boolean needCloseMenu, boolean needMapAdjust, int previousMenuState, int newMenuState, int dZoom, boolean animated) { - int y = super.applyPosY(currentY, needCloseMenu, needMapAdjust, previousMenuState, newMenuState, dZoom, animated); - if (needMapAdjust) { - adjustMapPosition(y); - } - return y; - } - public void updateToolbar(int y, boolean animated) { final MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { @@ -821,6 +815,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card if (r.left != 0 && r.right != 0) { mapActivity.getMapView().fitRectToMap(r.left, r.right, r.top, r.bottom, tileBoxWidthPx, tileBoxHeightPx, 0); } + mapPositionAdjusted = true; } } From effe5c96e3123b39713a658685e49d45250a9676 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 26 Jan 2021 18:47:33 +0200 Subject: [PATCH 2/4] Make widgets visibility in gpx menu same as in context menu --- .../osmand/plus/activities/MapActivity.java | 12 +++++- .../plus/mapcontextmenu/MapContextMenu.java | 32 ++++++++------- .../osmand/plus/track/TrackMenuFragment.java | 40 ++++++++++--------- .../plus/views/layers/MapControlsLayer.java | 12 +++--- .../mapwidgets/MapInfoWidgetsFactory.java | 4 +- .../mapwidgets/MapMarkersWidgetsFactory.java | 2 +- 6 files changed, 60 insertions(+), 42 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 316d5c36b2..0de562fa2b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -70,7 +70,6 @@ import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OnDismissDialogFragmentListener; import net.osmand.plus.OsmAndConstants; -import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmAndLocationSimulation; import net.osmand.plus.OsmandApplication; @@ -1568,6 +1567,17 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } } + public boolean shouldHideTopControls() { + boolean hideTopControls = !mapContextMenu.shouldShowTopControls(); + + TrackMenuFragment fragment = getTrackMenuFragment(); + if (fragment != null) { + hideTopControls = hideTopControls || !fragment.shouldShowTopControls(); + } + + return hideTopControls; + } + public OsmandMapTileView getMapView() { return mapView; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index c1a6a6cc0a..cd035da4bb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -22,18 +22,17 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.TransportStop; -import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.mapmarkers.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.TargetPointsHelper.TargetPointChangedListener; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.GpxUiHelper; +import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment.ContextMenuItemClickListener; import net.osmand.plus.mapcontextmenu.MenuController.ContextMenuToolbarController; import net.osmand.plus.mapcontextmenu.MenuController.MenuState; import net.osmand.plus.mapcontextmenu.MenuController.MenuType; @@ -47,12 +46,14 @@ import net.osmand.plus.mapcontextmenu.editors.RtePtEditor; import net.osmand.plus.mapcontextmenu.editors.WptPtEditor; import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu; import net.osmand.plus.mapcontextmenu.other.ShareMenu; -import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment.ContextMenuItemClickListener; +import net.osmand.plus.mapmarkers.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.routing.RoutingHelper; +import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.transport.TransportStopRoute; -import net.osmand.plus.views.layers.ContextMenuLayer; import net.osmand.plus.views.OsmandMapLayer; +import net.osmand.plus.views.layers.ContextMenuLayer; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarController; import net.osmand.plus.views.mapwidgets.MapInfoWidgetsFactory.TopToolbarControllerType; import net.osmand.util.Algorithms; @@ -570,18 +571,21 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL public void updateControlsVisibility(boolean menuVisible) { MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { - int topControlsVisibility = shouldShowTopControls(menuVisible) ? View.VISIBLE : View.GONE; - mapActivity.findViewById(R.id.map_center_info).setVisibility(topControlsVisibility); - mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(topControlsVisibility); - mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(topControlsVisibility); - - int bottomControlsVisibility = shouldShowBottomControls(menuVisible) ? View.VISIBLE : View.GONE; - mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(bottomControlsVisibility); - - mapActivity.refreshMap(); + boolean topControlsVisible = shouldShowTopControls(menuVisible); + boolean bottomControlsVisible = shouldShowBottomControls(menuVisible); + updateControlsVisibility(mapActivity, topControlsVisible, bottomControlsVisible); } } + public static void updateControlsVisibility(@NonNull MapActivity mapActivity, boolean topControlsVisible, boolean bottomControlsVisible) { + AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_center_info), topControlsVisible); + AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_left_widgets_panel), topControlsVisible); + AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), topControlsVisible); + AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.bottom_controls_container), bottomControlsVisible); + + mapActivity.refreshMap(); + } + public boolean shouldShowTopControls() { return shouldShowTopControls(isVisible()); } diff --git a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java index 0e21879f85..ff7a55180d 100644 --- a/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/track/TrackMenuFragment.java @@ -270,7 +270,6 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card setupToolbar(); updateHeader(); setupButtons(view); - enterTrackAppearanceMode(); runLayoutListener(); } return view; @@ -458,7 +457,12 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card @Override public void onContextMenuStateChanged(@NonNull ContextMenuFragment fragment, int currentMenuState, int previousMenuState) { super.onContextMenuStateChanged(fragment, currentMenuState, previousMenuState); - if (currentMenuState != MenuState.FULL_SCREEN && (currentMenuState != previousMenuState || !mapPositionAdjusted)) { + + boolean changed = currentMenuState != previousMenuState; + if (changed) { + updateControlsVisibility(true); + } + if (currentMenuState != MenuState.FULL_SCREEN && (changed || !mapPositionAdjusted)) { adjustMapPosition(getViewY()); } } @@ -466,7 +470,6 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card @Override public void onDestroyView() { super.onDestroyView(); - exitTrackAppearanceMode(); updateStatusBarColor(); } @@ -477,6 +480,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card if (mapActivity != null && trackChartPoints != null) { mapActivity.getMapLayers().getGpxLayer().setTrackChartPoints(trackChartPoints); } + updateControlsVisibility(true); startLocationUpdate(); } @@ -487,6 +491,7 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card if (mapActivity != null) { mapActivity.getMapLayers().getGpxLayer().setTrackChartPoints(null); } + updateControlsVisibility(false); stopLocationUpdate(); } @@ -572,26 +577,25 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card updateContent(); } - private void enterTrackAppearanceMode() { + public void updateControlsVisibility(boolean menuVisible) { MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { - boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity); - AndroidUiHelper.setVisibility(mapActivity, portrait ? View.INVISIBLE : View.GONE, - R.id.map_left_widgets_panel, - R.id.map_right_widgets_panel, - R.id.map_center_info); + boolean topControlsVisible = shouldShowTopControls(menuVisible); + boolean bottomControlsVisible = shouldShowBottomControls(menuVisible); + MapContextMenu.updateControlsVisibility(mapActivity, topControlsVisible, bottomControlsVisible); } } - private void exitTrackAppearanceMode() { - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - AndroidUiHelper.setVisibility(mapActivity, View.VISIBLE, - R.id.map_left_widgets_panel, - R.id.map_right_widgets_panel, - R.id.map_center_info, - R.id.map_search_button); - } + public boolean shouldShowTopControls() { + return shouldShowTopControls(isVisible()); + } + + public boolean shouldShowTopControls(boolean menuVisible) { + return !menuVisible || !isPortrait() || getCurrentMenuState() == MenuState.HEADER_ONLY; + } + + public boolean shouldShowBottomControls(boolean menuVisible) { + return !menuVisible || !isPortrait(); } @Override diff --git a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java index e4fe3a484c..22eb448670 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java @@ -859,30 +859,30 @@ public class MapControlsLayer extends OsmandMapLayer { } boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode(); boolean trackDialogOpened = mapActivity.getTrackDetailsMenu().isVisible(); - boolean contextMenuOpened = !mapActivity.getContextMenu().shouldShowTopControls(); + boolean shouldHideTopControls = mapActivity.shouldHideTopControls(); boolean showRouteCalculationControls = routePlanningMode || ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); boolean routeDialogOpened = mapRouteInfoMenu.isVisible() || (showRouteCalculationControls && mapRouteInfoMenu.needShowMenu()); - updateMyLocationVisibility(backToLocationControl, rh, routeDialogOpened || contextMenuOpened); + updateMyLocationVisibility(backToLocationControl, rh, routeDialogOpened || shouldHideTopControls); //routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_info_dark : R.drawable.ic_action_gdirections_dark); updateRoutePlaningButton(rh, routePlanningMode); boolean showBottomMenuButtons = (showRouteCalculationControls || !routeFollowingMode) && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() - && !isInPlanRouteMode() && !contextMenuOpened && !isInChoosingRoutesMode() + && !isInPlanRouteMode() && !shouldHideTopControls && !isInChoosingRoutesMode() && !isInWaypointsChoosingMode() && !isInFollowTrackMode() && !isInTrackAppearanceMode(); routePlanningBtn.updateVisibility(showBottomMenuButtons); menuControl.updateVisibility(showBottomMenuButtons); - boolean showZoomButtons = !routeDialogOpened && !contextMenuOpened && !isInTrackAppearanceMode() + boolean showZoomButtons = !routeDialogOpened && !shouldHideTopControls && !isInTrackAppearanceMode() && (!isInGpxApproximationMode() || !isPotrait()) && !isInFollowTrackMode() && (!isInChoosingRoutesMode() || !isInWaypointsChoosingMode() || !portrait); mapZoomIn.updateVisibility(showZoomButtons); mapZoomOut.updateVisibility(showZoomButtons); boolean forceHideCompass = routeDialogOpened || trackDialogOpened || isInMeasurementToolMode() - || isInPlanRouteMode() || contextMenuOpened || isInChoosingRoutesMode() + || isInPlanRouteMode() || shouldHideTopControls || isInChoosingRoutesMode() || isInTrackAppearanceMode() || isInWaypointsChoosingMode() || isInFollowTrackMode(); compassHud.forceHideCompass = forceHideCompass; compassHud.updateVisibility(!forceHideCompass && shouldShowCompass()); @@ -892,7 +892,7 @@ public class MapControlsLayer extends OsmandMapLayer { if (layersHud.setIconResId(appMode.getIconRes())) { layersHud.update(app, isNight); } - boolean showTopButtons = !routeDialogOpened && !trackDialogOpened && !contextMenuOpened + boolean showTopButtons = !routeDialogOpened && !trackDialogOpened && !shouldHideTopControls && !isInMeasurementToolMode() && !isInPlanRouteMode() && !isInChoosingRoutesMode() && !isInTrackAppearanceMode() && !isInWaypointsChoosingMode() && !isInFollowTrackMode(); layersHud.updateVisibility(showTopButtons); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index fca0ae429e..63c4c93ab9 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -974,7 +974,7 @@ public class MapInfoWidgetsFactory { } } } - if (map.isTopToolbarActive() || !map.getContextMenu().shouldShowTopControls() || MapRouteInfoMenu.chooseRoutesVisible || MapRouteInfoMenu.waypointsVisible) { + if (map.isTopToolbarActive() || map.shouldHideTopControls() || MapRouteInfoMenu.chooseRoutesVisible || MapRouteInfoMenu.waypointsVisible) { updateVisibility(false); } else if (showClosestWaypointFirstInAddress && updateWaypoint()) { updateVisibility(true); @@ -1232,7 +1232,7 @@ public class MapInfoWidgetsFactory { @SuppressLint("SetTextI18n") public boolean updateInfo() { - boolean visible = settings.SHOW_COORDINATES_WIDGET.get() && map.getContextMenu().shouldShowTopControls() + boolean visible = settings.SHOW_COORDINATES_WIDGET.get() && !map.shouldHideTopControls() && map.getMapRouteInfoMenu().shouldShowTopControls() && !map.isTopToolbarActive() && !map.getMapLayers().getGpxLayer().isInTrackAppearanceMode() && !MapRouteInfoMenu.chooseRoutesVisible && !MapRouteInfoMenu.waypointsVisible diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index f47c0f8bd6..ac0765cee5 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -191,7 +191,7 @@ public class MapMarkersWidgetsFactory { || map.getMapRouteInfoMenu().isVisible() || addressTopBar.getVisibility() == View.VISIBLE || map.isTopToolbarActive() - || !map.getContextMenu().shouldShowTopControls() + || map.shouldHideTopControls() || map.getMapLayers().getGpxLayer().isInTrackAppearanceMode() || map.getMapLayers().getMapMarkersLayer().isInPlanRouteMode()) { updateVisibility(false); From 62a8b4dbfe0b9f5bbd6cfdc7dd2b4896bfb28e47 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 26 Jan 2021 19:20:25 +0200 Subject: [PATCH 3/4] Add zoom buttons to gpx menu --- OsmAnd/res/layout/context_menu_controls.xml | 30 +++++++++++++++++++ OsmAnd/res/layout/follow_track_options.xml | 29 +----------------- OsmAnd/res/layout/track_appearance.xml | 29 +----------------- OsmAnd/res/layout/track_menu.xml | 2 ++ .../osmand/plus/track/TrackMenuFragment.java | 1 + .../views/layers/MapQuickActionLayer.java | 1 + 6 files changed, 36 insertions(+), 56 deletions(-) create mode 100644 OsmAnd/res/layout/context_menu_controls.xml diff --git a/OsmAnd/res/layout/context_menu_controls.xml b/OsmAnd/res/layout/context_menu_controls.xml new file mode 100644 index 0000000000..0132153f4f --- /dev/null +++ b/OsmAnd/res/layout/context_menu_controls.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/follow_track_options.xml b/OsmAnd/res/layout/follow_track_options.xml index 4523599e6c..0ca2466eb2 100644 --- a/OsmAnd/res/layout/follow_track_options.xml +++ b/OsmAnd/res/layout/follow_track_options.xml @@ -99,34 +99,7 @@ - - - - - - - + - - - - - - - + + + Date: Tue, 26 Jan 2021 19:35:22 +0200 Subject: [PATCH 4/4] Fix join gaps visibility --- OsmAnd/src/net/osmand/plus/track/OptionsCard.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/track/OptionsCard.java b/OsmAnd/src/net/osmand/plus/track/OptionsCard.java index e042a6ab6b..fef9f34f0b 100644 --- a/OsmAnd/src/net/osmand/plus/track/OptionsCard.java +++ b/OsmAnd/src/net/osmand/plus/track/OptionsCard.java @@ -74,7 +74,9 @@ public class OptionsCard extends BaseCard { items.add(createDirectionsItem()); } items.add(createDividerItem()); - items.add(createJoinGapsItem()); + if (gpxFile.getGeneralTrack() != null) { + items.add(createJoinGapsItem()); + } items.add(createAnalyzeOnMapItem()); items.add(createAnalyzeByIntervalsItem());