Add widget colors
This commit is contained in:
parent
a18c3c8b83
commit
259c66ced9
3 changed files with 12 additions and 10 deletions
|
@ -177,8 +177,10 @@
|
||||||
<color name="color_transparent">#0000</color>
|
<color name="color_transparent">#0000</color>
|
||||||
<color name="color_black_transparent">#90000000</color>
|
<color name="color_black_transparent">#90000000</color>
|
||||||
<color name="widgettext_night">#ffC8C8C8</color>
|
<color name="widgettext_night">#ffC8C8C8</color>
|
||||||
|
<color name="widgettext_day">#000</color>
|
||||||
<!-- widgettext_shadow_night is the same as widget background color for non-transparent night skin (from box_night_free_simple.9.png) -->
|
<!-- widgettext_shadow_night is the same as widget background color for non-transparent night skin (from box_night_free_simple.9.png) -->
|
||||||
<color name="widgettext_shadow_night">#dc262626</color>
|
<color name="widgettext_shadow_night">#dc262626</color>
|
||||||
|
<color name="widgettext_shadow_day">#fff</color>
|
||||||
|
|
||||||
<!-- style colors -->
|
<!-- style colors -->
|
||||||
<color name="group_background">#A5A5A5</color>
|
<color name="group_background">#A5A5A5</color>
|
||||||
|
|
|
@ -91,7 +91,6 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
|
|
||||||
private List<MapHudButton> controls = new ArrayList<>();
|
private List<MapHudButton> controls = new ArrayList<>();
|
||||||
private final MapActivity mapActivity;
|
private final MapActivity mapActivity;
|
||||||
private int shadowColor = -1;
|
|
||||||
// private RulerControl rulerControl;
|
// private RulerControl rulerControl;
|
||||||
// private List<MapControls> allControls = new ArrayList<MapControls>();
|
// private List<MapControls> allControls = new ArrayList<MapControls>();
|
||||||
|
|
||||||
|
@ -750,13 +749,12 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
private void updateControls(@NonNull RotatedTileBox tileBox, DrawSettings drawSettings) {
|
private void updateControls(@NonNull RotatedTileBox tileBox, DrawSettings drawSettings) {
|
||||||
boolean isNight = drawSettings != null && drawSettings.isNightMode();
|
boolean isNight = drawSettings != null && drawSettings.isNightMode();
|
||||||
boolean portrait = isPotrait();
|
boolean portrait = isPotrait();
|
||||||
int shadw = isNight ? Color.TRANSPARENT : Color.WHITE;
|
// int shadw = isNight ? mapActivity.getResources().getColor(R.color.widgettext_shadow_night) :
|
||||||
int textColor = isNight ? mapActivity.getResources().getColor(R.color.widgettext_night) : Color.BLACK;
|
// mapActivity.getResources().getColor(R.color.widgettext_shadow_day);
|
||||||
if (shadowColor != shadw) {
|
int textColor = isNight ? mapActivity.getResources().getColor(R.color.widgettext_night) :
|
||||||
shadowColor = shadw;
|
mapActivity.getResources().getColor(R.color.widgettext_day);
|
||||||
// TODOnightMode
|
// TODOnightMode
|
||||||
// updatextColor(textColor, shadw, rulerControl, zoomControls, mapMenuControls);
|
// updatextColor(textColor, shadw, rulerControl, zoomControls, mapMenuControls);
|
||||||
}
|
|
||||||
// default buttons
|
// default buttons
|
||||||
boolean routePlanningMode = false;
|
boolean routePlanningMode = false;
|
||||||
RoutingHelper rh = mapActivity.getRoutingHelper();
|
RoutingHelper rh = mapActivity.getRoutingHelper();
|
||||||
|
|
|
@ -305,9 +305,11 @@ public class MapInfoLayer extends OsmandMapLayer {
|
||||||
TextState ts = new TextState();
|
TextState ts = new TextState();
|
||||||
ts.textBold = following;
|
ts.textBold = following;
|
||||||
ts.night = nightMode;
|
ts.night = nightMode;
|
||||||
ts.textColor = nightMode ? ContextCompat.getColor(view.getContext(), R.color.widgettext_night) : Color.BLACK;
|
ts.textColor = nightMode ? ContextCompat.getColor(view.getContext(), R.color.widgettext_night) :
|
||||||
|
ContextCompat.getColor(view.getContext(), R.color.widgettext_day);
|
||||||
// Night shadowColor always use widgettext_shadow_night, same as widget background color for non-transparent
|
// Night shadowColor always use widgettext_shadow_night, same as widget background color for non-transparent
|
||||||
ts.textShadowColor = nightMode ? ContextCompat.getColor(view.getContext(), R.color.widgettext_shadow_night) : Color.WHITE;
|
ts.textShadowColor = nightMode ? ContextCompat.getColor(view.getContext(), R.color.widgettext_shadow_night) :
|
||||||
|
ContextCompat.getColor(view.getContext(), R.color.widgettext_shadow_day);
|
||||||
if (!transparent && !nightMode) {
|
if (!transparent && !nightMode) {
|
||||||
ts.textShadowRadius = 0;
|
ts.textShadowRadius = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue