Fix follow track visibility for already visible tracks

This commit is contained in:
Vitaliy 2020-09-09 10:12:20 +03:00
parent 1783796e59
commit 6294234e54
2 changed files with 8 additions and 1 deletions

View file

@ -116,6 +116,10 @@ public class GpxSelectionHelper {
}
}
public boolean shouldHideTrackToFollow() {
return shouldHideTrackToFollow;
}
private StateChangedListener<String> getFollowTrackListener() {
if (followTrackListener == null) {
followTrackListener = new StateChangedListener<String>() {

View file

@ -724,8 +724,11 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
private boolean showTrackToFollow() {
if (view.getContext() instanceof MapActivity) {
MapActivity mapActivity = (MapActivity) view.getContext();
OsmandApplication app = mapActivity.getMyApplication();
MapRouteInfoMenu routeInfoMenu = mapActivity.getMapRouteInfoMenu();
return routeInfoMenu.isVisible() || mapActivity.getRoutingHelper().isFollowingMode()
return !app.getSelectedGpxHelper().shouldHideTrackToFollow()
|| routeInfoMenu.isVisible()
|| app.getRoutingHelper().isFollowingMode()
|| MapRouteInfoMenu.followTrackVisible
|| MapRouteInfoMenu.chooseRoutesVisible
|| MapRouteInfoMenu.waypointsVisible;