Merge branch 'master' of ssh://github.com/osmandapp/Osmand into settings_improvements
This commit is contained in:
commit
a347acbd7c
3 changed files with 12 additions and 5 deletions
|
@ -158,6 +158,7 @@ public class TrackBitmapDrawer {
|
||||||
.setLocation(clat, clon)
|
.setLocation(clat, clon)
|
||||||
.setZoom(15)
|
.setZoom(15)
|
||||||
.density(density)
|
.density(density)
|
||||||
|
.setMapDensity(density)
|
||||||
.setPixelDimensions(widthPixels, heightPixels, 0.5f, 0.5f);
|
.setPixelDimensions(widthPixels, heightPixels, 0.5f, 0.5f);
|
||||||
|
|
||||||
rotatedTileBox = boxBuilder.build();
|
rotatedTileBox = boxBuilder.build();
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class RulerControlLayer extends OsmandMapLayer {
|
||||||
private QuadPoint cacheCenter;
|
private QuadPoint cacheCenter;
|
||||||
private float cacheMapDensity;
|
private float cacheMapDensity;
|
||||||
private OsmandSettings.OsmandPreference<Float> mapDensity;
|
private OsmandSettings.OsmandPreference<Float> mapDensity;
|
||||||
|
private OsmandSettings.MetricsConstants cacheMetricSystem;
|
||||||
private int cacheIntZoom;
|
private int cacheIntZoom;
|
||||||
private double cacheTileX;
|
private double cacheTileX;
|
||||||
private double cacheTileY;
|
private double cacheTileY;
|
||||||
|
@ -127,7 +128,8 @@ public class RulerControlLayer extends OsmandMapLayer {
|
||||||
public void initLayer(final OsmandMapTileView view) {
|
public void initLayer(final OsmandMapTileView view) {
|
||||||
app = mapActivity.getMyApplication();
|
app = mapActivity.getMyApplication();
|
||||||
this.view = view;
|
this.view = view;
|
||||||
mapDensity = mapActivity.getMyApplication().getSettings().MAP_DENSITY;
|
mapDensity = app.getSettings().MAP_DENSITY;
|
||||||
|
cacheMetricSystem = app.getSettings().METRIC_SYSTEM.get();
|
||||||
cacheMapDensity = mapDensity.get();
|
cacheMapDensity = mapDensity.get();
|
||||||
cacheDistances = new ArrayList<>();
|
cacheDistances = new ArrayList<>();
|
||||||
cacheCenter = new QuadPoint();
|
cacheCenter = new QuadPoint();
|
||||||
|
@ -443,10 +445,13 @@ public class RulerControlLayer extends OsmandMapLayer {
|
||||||
updateCenter(tb, center);
|
updateCenter(tb, center);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean move = tb.getZoom() != cacheIntZoom || Math.abs(tb.getCenterTileX() - cacheTileX) > 1 ||
|
OsmandSettings.MetricsConstants currentMetricSystem = app.getSettings().METRIC_SYSTEM.get();
|
||||||
Math.abs(tb.getCenterTileY() - cacheTileY) > 1 || mapDensity.get() != cacheMapDensity;
|
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();
|
cacheIntZoom = tb.getZoom();
|
||||||
cacheTileX = tb.getCenterTileX();
|
cacheTileX = tb.getCenterTileX();
|
||||||
cacheTileY = tb.getCenterTileY();
|
cacheTileY = tb.getCenterTileY();
|
||||||
|
|
|
@ -92,8 +92,9 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
|
||||||
|
|
||||||
setupToolbar((Toolbar) mainView.findViewById(R.id.toolbar));
|
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 = (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(
|
ColorStateList selectedLangColorStateList = AndroidUtils.createPressedColorStateList(
|
||||||
getContext(), nightMode,
|
getContext(), nightMode,
|
||||||
R.color.icon_color_default_light, R.color.wikivoyage_active_light,
|
R.color.icon_color_default_light, R.color.wikivoyage_active_light,
|
||||||
|
|
Loading…
Reference in a new issue