Fix transparent color

This commit is contained in:
Victor Shcherb 2012-08-31 01:12:27 +02:00
parent 3e24946f34
commit ec638e691d
2 changed files with 18 additions and 21 deletions

View file

@ -193,6 +193,19 @@ public class MapInfoLayer extends OsmandMapLayer {
leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); leftStack.setExpandImageDrawable(view.getResources().getDrawable(expand));
rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand)); rightStack.setExpandImageDrawable(view.getResources().getDrawable(expand));
statusBar.setBackgroundDrawable(view.getResources().getDrawable(boxTop)); 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(){ public void registerAllControls(){
@ -607,15 +620,7 @@ public class MapInfoLayer extends OsmandMapLayer {
@Override @Override
public void onDraw(Canvas canvas, RectF latlonBounds, RectF tilesRect, DrawSettings nightMode) { public void onDraw(Canvas canvas, RectF latlonBounds, RectF tilesRect, DrawSettings nightMode) {
boolean bold = routeLayer.getHelper().isFollowingMode(); 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) { if(paintText.isFakeBoldText() != bold) {
paintText.setFakeBoldText(bold); paintText.setFakeBoldText(bold);
topText.getPaint().setFakeBoldText(bold); topText.getPaint().setFakeBoldText(bold);
@ -623,12 +628,10 @@ public class MapInfoLayer extends OsmandMapLayer {
paintSmallText.setFakeBoldText(bold); paintSmallText.setFakeBoldText(bold);
paintSmallSubText.setFakeBoldText(bold); paintSmallSubText.setFakeBoldText(bold);
} }
if(topText.getShadowColor() != shadowColor) {
topText.setShadowColor(shadowColor);
}
// update data on draw // update data on draw
rightStack.updateInfo(shadowColor); rightStack.updateInfo();
leftStack.updateInfo(shadowColor); leftStack.updateInfo();
lanesControl.updateInfo(); lanesControl.updateInfo();
alarmControl.updateInfo(); alarmControl.updateInfo();
for (int i = 0; i < statusBar.getChildCount(); i++) { for (int i = 0; i < statusBar.getChildCount(); i++) {

View file

@ -72,19 +72,13 @@ public class MapStackControl extends ViewGroup {
this.cacheStackDrawables.clear(); this.cacheStackDrawables.clear();
} }
public void updateInfo(int shadowColor) { public void updateInfo() {
for (MapInfoControl v : stackViews) { for (MapInfoControl v : stackViews) {
v.updateInfo(); v.updateInfo();
if(v.getShadowColor() != shadowColor) {
v.setShadowColor(shadowColor);
}
} }
// update even if collapsed to know if view becomes visible // update even if collapsed to know if view becomes visible
for (MapInfoControl v : collapsedViews) { for (MapInfoControl v : collapsedViews) {
v.updateInfo(); v.updateInfo();
if(v.getShadowColor() != shadowColor) {
v.setShadowColor(shadowColor);
}
} }
} }