Update location icons

This commit is contained in:
Victor Shcherb 2013-04-21 20:56:03 +02:00
parent dce85cd9dd
commit 391ed634ed
11 changed files with 40 additions and 15 deletions

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -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>

View 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>

View 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>

View file

@ -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>

View file

@ -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;
}
};