From ec638e691d4cb02167547ab4e072bcb50644aada Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 31 Aug 2012 01:12:27 +0200 Subject: [PATCH] Fix transparent color --- .../net/osmand/plus/views/MapInfoLayer.java | 31 ++++++++++--------- .../osmand/plus/views/MapStackControl.java | 8 +---- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index fa19298ac9..31ebe7f0ae 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -193,6 +193,19 @@ public class MapInfoLayer extends OsmandMapLayer { leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); statusBar.setBackgroundDrawable(view.getResources().getDrawable(boxTop)); + + int color = Color.BLACK; + int shadowColor = !view.getSettings().TRANSPARENT_MAP_THEME.get() ? Color.TRANSPARENT : Color.WHITE; + if(paintText.getColor() != color) { + paintText.setColor(color); + topText.setTextColor(color); + paintSubText.setColor(color); + paintSmallText.setColor(color); + paintSmallSubText.setColor(color); + } + if(topText.getShadowColor() != shadowColor) { + topText.setShadowColor(shadowColor); + } } public void registerAllControls(){ @@ -607,15 +620,7 @@ public class MapInfoLayer extends OsmandMapLayer { @Override public void onDraw(Canvas canvas, RectF latlonBounds, RectF tilesRect, DrawSettings nightMode) { boolean bold = routeLayer.getHelper().isFollowingMode(); - int color = !nightMode.isNightMode() ? Color.BLACK : Color.BLACK; - int shadowColor = nightMode.isNightMode() ? Color.TRANSPARENT : Color.WHITE; - if(paintText.getColor() != color) { - paintText.setColor(color); - topText.setTextColor(color); - paintSubText.setColor(color); - paintSmallText.setColor(color); - paintSmallSubText.setColor(color); - } + if(paintText.isFakeBoldText() != bold) { paintText.setFakeBoldText(bold); topText.getPaint().setFakeBoldText(bold); @@ -623,12 +628,10 @@ public class MapInfoLayer extends OsmandMapLayer { paintSmallText.setFakeBoldText(bold); paintSmallSubText.setFakeBoldText(bold); } - if(topText.getShadowColor() != shadowColor) { - topText.setShadowColor(shadowColor); - } + // update data on draw - rightStack.updateInfo(shadowColor); - leftStack.updateInfo(shadowColor); + rightStack.updateInfo(); + leftStack.updateInfo(); lanesControl.updateInfo(); alarmControl.updateInfo(); for (int i = 0; i < statusBar.getChildCount(); i++) { diff --git a/OsmAnd/src/net/osmand/plus/views/MapStackControl.java b/OsmAnd/src/net/osmand/plus/views/MapStackControl.java index 736c87c865..5387bd5aaf 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapStackControl.java +++ b/OsmAnd/src/net/osmand/plus/views/MapStackControl.java @@ -72,19 +72,13 @@ public class MapStackControl extends ViewGroup { this.cacheStackDrawables.clear(); } - public void updateInfo(int shadowColor) { + public void updateInfo() { for (MapInfoControl v : stackViews) { v.updateInfo(); - if(v.getShadowColor() != shadowColor) { - v.setShadowColor(shadowColor); - } } // update even if collapsed to know if view becomes visible for (MapInfoControl v : collapsedViews) { v.updateInfo(); - if(v.getShadowColor() != shadowColor) { - v.setShadowColor(shadowColor); - } } }