diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java index efc0376ffa..0f803f960f 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java @@ -158,6 +158,7 @@ public class TrackBitmapDrawer { .setLocation(clat, clon) .setZoom(15) .density(density) + .setMapDensity(density) .setPixelDimensions(widthPixels, heightPixels, 0.5f, 0.5f); rotatedTileBox = boxBuilder.build(); diff --git a/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java b/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java index 6c610dde71..87c2a15d0d 100644 --- a/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java @@ -64,6 +64,7 @@ public class RulerControlLayer extends OsmandMapLayer { private QuadPoint cacheCenter; private float cacheMapDensity; private OsmandSettings.OsmandPreference mapDensity; + private OsmandSettings.MetricsConstants cacheMetricSystem; private int cacheIntZoom; private double cacheTileX; private double cacheTileY; @@ -127,7 +128,8 @@ public class RulerControlLayer extends OsmandMapLayer { public void initLayer(final OsmandMapTileView view) { app = mapActivity.getMyApplication(); this.view = view; - mapDensity = mapActivity.getMyApplication().getSettings().MAP_DENSITY; + mapDensity = app.getSettings().MAP_DENSITY; + cacheMetricSystem = app.getSettings().METRIC_SYSTEM.get(); cacheMapDensity = mapDensity.get(); cacheDistances = new ArrayList<>(); cacheCenter = new QuadPoint(); @@ -443,10 +445,13 @@ public class RulerControlLayer extends OsmandMapLayer { updateCenter(tb, center); } - boolean move = tb.getZoom() != cacheIntZoom || Math.abs(tb.getCenterTileX() - cacheTileX) > 1 || - Math.abs(tb.getCenterTileY() - cacheTileY) > 1 || mapDensity.get() != cacheMapDensity; + OsmandSettings.MetricsConstants currentMetricSystem = app.getSettings().METRIC_SYSTEM.get(); + boolean updateCache = tb.getZoom() != cacheIntZoom || Math.abs(tb.getCenterTileX() - cacheTileX) > 1 + || Math.abs(tb.getCenterTileY() - cacheTileY) > 1 || mapDensity.get() != cacheMapDensity + || cacheMetricSystem != currentMetricSystem; - if (!tb.isZoomAnimated() && move) { + if (!tb.isZoomAnimated() && updateCache) { + cacheMetricSystem = currentMetricSystem; cacheIntZoom = tb.getZoom(); cacheTileX = tb.getCenterTileX(); cacheTileY = tb.getCenterTileY(); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 2b3d93d559..c27858ce3d 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -92,8 +92,9 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme setupToolbar((Toolbar) mainView.findViewById(R.id.toolbar)); + int appBarTextColor = nightMode ? R.color.wikivoyage_app_bar_text_dark : R.color.wikivoyage_app_bar_text_light; articleToolbarText = (TextView) mainView.findViewById(R.id.article_toolbar_text); - articleToolbarText.setTextColor(ContextCompat.getColor(getContext(), R.color.text_color_primary_dark)); + articleToolbarText.setTextColor(ContextCompat.getColor(getContext(), appBarTextColor)); ColorStateList selectedLangColorStateList = AndroidUtils.createPressedColorStateList( getContext(), nightMode, R.color.icon_color_default_light, R.color.wikivoyage_active_light,