diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java index 65f615d94a..427a9479da 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java @@ -53,7 +53,6 @@ public class RouteLineAppearanceFragment extends ContextMenuScrollFragment private int toolbarHeightPx; private DayNightMode initMapTheme; private DayNightMode selectedMapTheme; - private HeaderUiAdapter headerUiAdapter; private HeaderInfo selectedHeader; private View buttonsShadow; @@ -311,12 +310,16 @@ public class RouteLineAppearanceFragment extends ContextMenuScrollFragment } private void updateHeaderState() { + HeaderInfo header; if (getBottomScrollView().getScrollY() > colorCard.getViewHeight() + headerTitle.getBottom()) { - selectedHeader = widthCard; + header = widthCard; } else { - selectedHeader = colorCard; + header = colorCard; + } + if (header != selectedHeader) { + selectedHeader = header; + selectedHeader.onNeedUpdateHeader(); } - selectedHeader.onNeedUpdateHeader(); } private void initVisibleRect() { diff --git a/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java index 4508ab089b..71c74579a3 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java @@ -107,7 +107,6 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont private LayerDrawable previewIcon; private int routeLineColor; - private float routeLineWidth; private Integer directionArrowsColor; public RouteLayer(RoutingHelper helper) { @@ -467,7 +466,7 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont } else { widthKey = view.getSettings().ROUTE_LINE_WIDTH.getModeValue(helper.getAppMode()); } - return routeLineWidth = widthKey != null ? getWidthByKey(tileBox, widthKey) : attrs.paint.getStrokeWidth(); + return widthKey != null ? getWidthByKey(tileBox, widthKey) : attrs.paint.getStrokeWidth(); } @Nullable