diff --git a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_disabled.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_disabled.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/list_activities_backtoloc_disabled.png
rename to OsmAnd/res/drawable-hdpi/la_backtoloc_disabled.png
diff --git a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_disabled_white.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_disabled_white.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/list_activities_backtoloc_disabled_white.png
rename to OsmAnd/res/drawable-hdpi/la_backtoloc_disabled_white.png
diff --git a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled_white.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_enabled.png
similarity index 70%
rename from OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled_white.png
rename to OsmAnd/res/drawable-hdpi/la_backtoloc_enabled.png
index 885bea7f78..3347443c08 100644
Binary files a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled_white.png and b/OsmAnd/res/drawable-hdpi/la_backtoloc_enabled.png differ
diff --git a/OsmAnd/res/drawable-hdpi/la_backtoloc_enabled_white.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_enabled_white.png
new file mode 100644
index 0000000000..a96327e764
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/la_backtoloc_enabled_white.png differ
diff --git a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_tracked.png
similarity index 71%
rename from OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled.png
rename to OsmAnd/res/drawable-hdpi/la_backtoloc_tracked.png
index 7aacf3b632..94034f03a5 100644
Binary files a/OsmAnd/res/drawable-hdpi/list_activities_backtoloc_enabled.png and b/OsmAnd/res/drawable-hdpi/la_backtoloc_tracked.png differ
diff --git a/OsmAnd/res/drawable-hdpi/la_backtoloc_tracked_white.png b/OsmAnd/res/drawable-hdpi/la_backtoloc_tracked_white.png
new file mode 100644
index 0000000000..08810a75f5
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/la_backtoloc_tracked_white.png differ
diff --git a/OsmAnd/res/drawable/back_to_loc.xml b/OsmAnd/res/drawable/back_to_loc.xml
index 59e2d41219..0faf5acbde 100644
--- a/OsmAnd/res/drawable/back_to_loc.xml
+++ b/OsmAnd/res/drawable/back_to_loc.xml
@@ -1,7 +1,7 @@
-
-
-
-
+
+
+
+
diff --git a/OsmAnd/res/drawable/back_to_loc_tracked.xml b/OsmAnd/res/drawable/back_to_loc_tracked.xml
new file mode 100644
index 0000000000..791fb060eb
--- /dev/null
+++ b/OsmAnd/res/drawable/back_to_loc_tracked.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/back_to_loc_tracked_white.xml b/OsmAnd/res/drawable/back_to_loc_tracked_white.xml
new file mode 100644
index 0000000000..3ccee63e1b
--- /dev/null
+++ b/OsmAnd/res/drawable/back_to_loc_tracked_white.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/back_to_loc_white.xml b/OsmAnd/res/drawable/back_to_loc_white.xml
index aca4855514..cc7798fe48 100644
--- a/OsmAnd/res/drawable/back_to_loc_white.xml
+++ b/OsmAnd/res/drawable/back_to_loc_white.xml
@@ -1,7 +1,7 @@
-
-
-
-
+
+
+
+
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
index 3f66df2648..e0739b1120 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
@@ -102,19 +102,30 @@ public class MapInfoWidgetsFactory {
public ImageView createBackToLocation(final MapActivity map){
final Drawable backToLoc = map.getResources().getDrawable(R.drawable.back_to_loc);
final Drawable backToLocWhite = map.getResources().getDrawable(R.drawable.back_to_loc_white);
+ final Drawable backToLocDisabled = map.getResources().getDrawable(R.drawable.la_backtoloc_disabled);
+ final Drawable backToLocDisabledWhite = map.getResources().getDrawable(R.drawable.la_backtoloc_disabled_white);
+ final Drawable backToLocTracked = map.getResources().getDrawable(R.drawable.back_to_loc_tracked);
+ final Drawable backToLocTrackedWhite = map.getResources().getDrawable(R.drawable.back_to_loc_tracked_white);
ImageView backToLocation = new ImageViewWidget(map) {
- private boolean nightM;
+ Drawable lastDrawable = null;
@Override
public boolean updateInfo(DrawSettings drawSettings) {
boolean nightMode = drawSettings == null ? false : drawSettings.isNightMode();
- if(nightM != nightMode) {
- nightM = nightMode;
- setImageDrawable(nightM ? backToLocWhite : backToLoc);
- }
boolean enabled = map.getMyApplication().getLocationProvider().getLastKnownLocation() != null;
- enabled = enabled && !map.getMapViewTrackingUtilities().isMapLinkedToLocation();
- setEnabled(enabled);
+ boolean tracked = map.getMapViewTrackingUtilities().isMapLinkedToLocation();
+ Drawable d;
+ if(!enabled) {
+ d = nightMode ? backToLocDisabledWhite : backToLocDisabled;
+ } else if(tracked) {
+ d = nightMode ? backToLocTrackedWhite : backToLocTracked;
+ } else {
+ d = nightMode ? backToLocWhite : backToLoc;
+ }
+ if(d != lastDrawable) {
+ lastDrawable = d;
+ setImageDrawable(d);
+ }
return true;
}
};