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)
|
||||
.setZoom(15)
|
||||
.density(density)
|
||||
.setMapDensity(density)
|
||||
.setPixelDimensions(widthPixels, heightPixels, 0.5f, 0.5f);
|
||||
|
||||
rotatedTileBox = boxBuilder.build();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue