Merge "Update power widget icons and fix location behavior Bug: 11242129" into klp-dev
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 1001 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
res/drawable-hdpi/ic_appwidget_settings_location_saving_holo.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 976 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 965 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 910 B |
BIN
res/drawable-mdpi/ic_appwidget_settings_location_saving_holo.png
Normal file
After Width: | Height: | Size: 979 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
res/drawable-xxhdpi/appwidget_settings_ind_on_c_holo.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
res/drawable-xxhdpi/appwidget_settings_ind_on_l_holo.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
res/drawable-xxhdpi/appwidget_settings_ind_on_r_holo.9.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_bluetooth_off_holo.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_bluetooth_on_holo.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_sync_off_holo.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_sync_on_holo.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_wifi_off_holo.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
res/drawable-xxhdpi/ic_appwidget_settings_wifi_on_holo.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
@@ -509,27 +509,33 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {
|
||||
* Subclass of StateTracker for location state.
|
||||
*/
|
||||
private static final class LocationStateTracker extends StateTracker {
|
||||
private int mCurrentLocationMode = Settings.Secure.LOCATION_MODE_OFF;
|
||||
|
||||
public int getContainerId() { return R.id.btn_location; }
|
||||
public int getButtonId() { return R.id.img_location; }
|
||||
public int getIndicatorId() { return R.id.ind_location; }
|
||||
public int getButtonDescription() { return R.string.gadget_location; }
|
||||
public int getButtonImageId(boolean on) {
|
||||
return on ? R.drawable.ic_appwidget_settings_location_on_holo
|
||||
: R.drawable.ic_appwidget_settings_location_off_holo;
|
||||
if (on) {
|
||||
switch (mCurrentLocationMode) {
|
||||
case Settings.Secure.LOCATION_MODE_HIGH_ACCURACY:
|
||||
case Settings.Secure.LOCATION_MODE_SENSORS_ONLY:
|
||||
return R.drawable.ic_appwidget_settings_location_on_holo;
|
||||
default:
|
||||
return R.drawable.ic_appwidget_settings_location_saving_holo;
|
||||
}
|
||||
}
|
||||
|
||||
return R.drawable.ic_appwidget_settings_location_off_holo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActualState(Context context) {
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
int currentLocationMode = Settings.Secure.getInt(resolver,
|
||||
mCurrentLocationMode = Settings.Secure.getInt(resolver,
|
||||
Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
|
||||
switch (currentLocationMode) {
|
||||
case Settings.Secure.LOCATION_MODE_BATTERY_SAVING:
|
||||
case Settings.Secure.LOCATION_MODE_OFF:
|
||||
return STATE_DISABLED;
|
||||
}
|
||||
|
||||
return STATE_ENABLED;
|
||||
return (mCurrentLocationMode == Settings.Secure.LOCATION_MODE_OFF)
|
||||
? STATE_DISABLED : STATE_ENABLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -566,7 +572,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider {
|
||||
break;
|
||||
}
|
||||
Settings.Secure.putInt(resolver, Settings.Secure.LOCATION_MODE, mode);
|
||||
return desiredState;
|
||||
return mode != Settings.Secure.LOCATION_MODE_OFF;
|
||||
}
|
||||
|
||||
return getActualState(context) == STATE_ENABLED;
|
||||
|