Update location icons
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
OsmAnd/res/drawable-hdpi/la_backtoloc_enabled_white.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
OsmAnd/res/drawable-hdpi/la_backtoloc_tracked_white.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:drawable="@drawable/list_activities_backtoloc_disabled" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/list_activities_backtoloc_disabled" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/list_activities_backtoloc_disabled" />
|
||||
<item android:drawable="@drawable/list_activities_backtoloc_enabled" />
|
||||
<item android:state_enabled="false" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:drawable="@drawable/la_backtoloc_enabled" />
|
||||
</selector>
|
||||
|
|
7
OsmAnd/res/drawable/back_to_loc_tracked.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/la_backtoloc_disabled" />
|
||||
<item android:drawable="@drawable/la_backtoloc_tracked" />
|
||||
</selector>
|
7
OsmAnd/res/drawable/back_to_loc_tracked_white.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:drawable="@drawable/la_backtoloc_tracked_white" />
|
||||
</selector>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:drawable="@drawable/list_activities_backtoloc_disabled_white" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/list_activities_backtoloc_disabled_white" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/list_activities_backtoloc_disabled_white" />
|
||||
<item android:drawable="@drawable/list_activities_backtoloc_enabled_white" />
|
||||
<item android:state_enabled="false" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:state_focused="true" android:drawable="@drawable/la_backtoloc_disabled_white" />
|
||||
<item android:drawable="@drawable/la_backtoloc_enabled_white" />
|
||||
</selector>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|