aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChumva <faiver.unknown@gmail.com>2019-10-17 09:22:56 +0300
committerChumva <faiver.unknown@gmail.com>2019-10-17 09:22:56 +0300
commita347acbd7c425822e100f6ad4748864cac917d27 (patch)
tree69d2636c19ae8d60bd173e20bd243324434641df
parentcdede9d97e03fa5edb7c10b239e107be8972852f (diff)
parent12892e20ea2abf41a20e090eb55d805e9f78e63c (diff)
downloadOsmand-a347acbd7c425822e100f6ad4748864cac917d27.tar.gz
Merge branch 'master' of ssh://github.com/osmandapp/Osmand into settings_improvements
-rw-r--r--OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java1
-rw-r--r--OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java13
-rw-r--r--OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java3
3 files changed, 12 insertions, 5 deletions
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<Float> 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,