Update icons
This commit is contained in:
parent
3ca7d11ba5
commit
a7c0717867
5 changed files with 29 additions and 7 deletions
|
@ -14,7 +14,7 @@
|
||||||
android:insetRight="@dimen/map_button_inset_shadow"
|
android:insetRight="@dimen/map_button_inset_shadow"
|
||||||
android:insetTop="@dimen/map_button_inset_shadow" >
|
android:insetTop="@dimen/map_button_inset_shadow" >
|
||||||
<shape android:shape="oval" >
|
<shape android:shape="oval" >
|
||||||
<solid android:color="@color/map_widget_light_pressed" />
|
<solid android:color="@color/map_widget_light" />
|
||||||
</shape>
|
</shape>
|
||||||
</inset>
|
</inset>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<dimen name="map_button_size">50dp</dimen>
|
<dimen name="map_button_size">50dp</dimen>
|
||||||
<dimen name="map_ruler_width">120dp</dimen>
|
<dimen name="map_ruler_width">120dp</dimen>
|
||||||
<dimen name="map_ruler_bottom_margin">7dp</dimen>
|
<dimen name="map_ruler_bottom_margin">7dp</dimen>
|
||||||
<dimen name="map_button_shadow_width">52dp</dimen>
|
<dimen name="map_button_shadow_width">54dp</dimen>
|
||||||
<dimen name="map_alarm_size">78dp</dimen>
|
<dimen name="map_alarm_size">78dp</dimen>
|
||||||
<dimen name="map_alarm_text_size">25sp</dimen>
|
<dimen name="map_alarm_text_size">25sp</dimen>
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
<dimen name="map_routing_progress_width">100dp</dimen>
|
<dimen name="map_routing_progress_width">100dp</dimen>
|
||||||
|
|
||||||
<dimen name="map_button_shadow_margin">2dp</dimen>
|
<dimen name="map_button_shadow_margin">2dp</dimen>
|
||||||
<dimen name="map_button_inset_shadow">2dp</dimen>
|
<dimen name="map_button_inset_shadow">1dp</dimen>
|
||||||
<dimen name="map_button_inset">4dp</dimen>
|
<dimen name="map_button_inset">4dp</dimen>
|
||||||
<dimen name="map_button_rect_rad">3dp</dimen>
|
<dimen name="map_button_rect_rad">3dp</dimen>
|
||||||
<dimen name="map_button_stroke">1px</dimen>
|
<dimen name="map_button_stroke">1px</dimen>
|
||||||
|
|
|
@ -527,12 +527,17 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
// final Drawable backToLocTrackedWhite = map.getResources().getDrawable(R.drawable.back_to_loc_tracked_white);
|
// final Drawable backToLocTrackedWhite = map.getResources().getDrawable(R.drawable.back_to_loc_tracked_white);
|
||||||
boolean enabled = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation() != null;
|
boolean enabled = mapActivity.getMyApplication().getLocationProvider().getLastKnownLocation() != null;
|
||||||
boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation();
|
boolean tracked = mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation();
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
backToLocationControl.setIconColorId(R.color.icon_color_light);
|
backToLocationControl.setBg(R.drawable.btn_circle, R.drawable.btn_circle_night);
|
||||||
|
backToLocationControl.setIconColorId(R.color.icon_color_light, 0);
|
||||||
} else if (tracked) {
|
} else if (tracked) {
|
||||||
backToLocationControl.setIconColorId(R.color.color_distance);
|
backToLocationControl.setIconColorId(0);
|
||||||
|
backToLocationControl.setBg(R.drawable.btn_circle_blue);
|
||||||
} else {
|
} else {
|
||||||
backToLocationControl.setIconColorId(R.color.color_white);
|
// TODO different icon
|
||||||
|
backToLocationControl.setIconColorId(R.color.map_widget_icon_color);
|
||||||
|
backToLocationControl.setBg(R.drawable.btn_circle_blue);
|
||||||
}
|
}
|
||||||
boolean visible = !(tracked && rh.isFollowingMode());
|
boolean visible = !(tracked && rh.isFollowingMode());
|
||||||
backToLocationControl.updateVisibility(visible);
|
backToLocationControl.updateVisibility(visible);
|
||||||
|
@ -628,6 +633,9 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapHudButton setBg(int dayBg, int nightBg) {
|
public MapHudButton setBg(int dayBg, int nightBg) {
|
||||||
|
if(bgDark == nightBg && dayBg == bgLight) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
bgDark = nightBg;
|
bgDark = nightBg;
|
||||||
bgLight = dayBg;
|
bgLight = dayBg;
|
||||||
f = true;
|
f = true;
|
||||||
|
@ -648,6 +656,9 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapHudButton setBg(int bg) {
|
public MapHudButton setBg(int bg) {
|
||||||
|
if(bgDark == bg && bg == bgLight) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
bgDark = bg;
|
bgDark = bg;
|
||||||
bgLight = bg;
|
bgLight = bg;
|
||||||
f = true;
|
f = true;
|
||||||
|
@ -672,6 +683,16 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
f = true;
|
f = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapHudButton setIconColorId(int clrLight, int clrDark) {
|
||||||
|
if (resLight == clrLight && resDark == clrDark) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
resLight = clrLight;
|
||||||
|
resDark = clrDark;
|
||||||
|
f = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void update(OsmandApplication ctx, boolean night) {
|
public void update(OsmandApplication ctx, boolean night) {
|
||||||
if (nightMode == night && !f) {
|
if (nightMode == night && !f) {
|
||||||
|
|
|
@ -349,6 +349,8 @@ public class MapInfoWidgetsFactory {
|
||||||
RouteDataObject rt = locationProvider.getLastKnownRouteSegment();
|
RouteDataObject rt = locationProvider.getLastKnownRouteSegment();
|
||||||
if(rt != null) {
|
if(rt != null) {
|
||||||
text = RoutingHelper.formatStreetName(rt.getName(), rt.getRef(), rt.getDestinationName());
|
text = RoutingHelper.formatStreetName(rt.getName(), rt.getRef(), rt.getDestinationName());
|
||||||
|
} else {
|
||||||
|
text = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!showNextTurn && updateWaypoint()) {
|
if(!showNextTurn && updateWaypoint()) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Application;
|
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
Loading…
Reference in a new issue