summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@gmail.com>2014-12-10 22:55:44 +0200
committerMichael Bestas <mikeioannina@gmail.com>2014-12-10 22:55:44 +0200
commit1d5af43ed6664bd809e70031dab35bed542cc65d (patch)
treee4e599e0ec76428d0c1a970e8001d0441c43afa0
parent40f2acefbced168760e976211dbb0594ef503a5d (diff)
downloadandroid_packages_apps_DeskClock-1d5af43ed6664bd809e70031dab35bed542cc65d.tar.gz
android_packages_apps_DeskClock-1d5af43ed6664bd809e70031dab35bed542cc65d.tar.bz2
android_packages_apps_DeskClock-1d5af43ed6664bd809e70031dab35bed542cc65d.zip
DeskClock: Make settings consistent
* Move status bar icon setting to the bottom * Match volume button summary with shake/flip actions * Match shake/flip actions popup with volume buttons popup setting * Make dialog titles consistent Change-Id: If9000bc843b0feeab40118ee00bd61fbcddf4e9a
-rw-r--r--res/values/cm_arrays.xml7
-rwxr-xr-xres/values/cm_strings.xml15
-rw-r--r--res/xml/settings.xml28
-rw-r--r--src/com/android/deskclock/SettingsActivity.java5
4 files changed, 21 insertions, 34 deletions
diff --git a/res/values/cm_arrays.xml b/res/values/cm_arrays.xml
index 63c40d743..2eb0f6d76 100644
--- a/res/values/cm_arrays.xml
+++ b/res/values/cm_arrays.xml
@@ -23,13 +23,6 @@
<item>@string/action_summary_do_nothing</item>
</string-array>
- <!-- Values for for shake and flip actions -->
- <string-array name="action_summary_values" translatable="false">
- <item>1</item>
- <item>2</item>
- <item>0</item>
- </string-array>
-
<string-array name="ringtone_picker_entries" translatable="false">
<item>@string/alarm_type_ringtone</item>
<item>@string/alarm_type_playlist</item>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 1d3dee1fb..8ffdb1713 100755
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -47,13 +47,12 @@
<string name="cities_delete_city_msg">Do you want to delete <xliff:g id="city">%s</xliff:g>?</string>
<string name="cities_delete_city_failed">Can\'t delete the city</string>
+ <!-- Setting summary for volume buttons setting. -->
+ <string name="volume_buttons_summary">Pressing the volume buttons will <xliff:g id="action">%s</xliff:g></string>
+
<!-- Setting title for the flip action setting. -->
<string name="flip_action_title">Flip action</string>
- <!-- Dialog title of the flip action setting. -->
- <string name="flip_action_dialog_title" product="tablet">Flip the tablet to\u2026</string>
- <string name="flip_action_dialog_title" product="default">Flip the phone to\u2026</string>
-
<!-- Setting summary for the flip action setting. -->
<string name="flip_action_summary" product="tablet">Flipping the tablet down will <xliff:g id="action">%s</xliff:g></string>
<string name="flip_action_summary" product="default">Flipping the phone down will <xliff:g id="action">%s</xliff:g></string>
@@ -61,17 +60,13 @@
<!-- Setting title for the shake action setting. -->
<string name="shake_action_title">Shake action</string>
- <!-- Dialog title for the shake action setting. -->
- <string name="shake_action_dialog_title" product="tablet">Shake the tablet to\u2026</string>
- <string name="shake_action_dialog_title" product="default">Shake the phone to\u2026</string>
-
<!-- Setting summary for the shake action setting. -->
<string name="shake_action_summary" product="tablet">Shaking the tablet will <xliff:g id="action">%s</xliff:g></string>
<string name="shake_action_summary" product="default">Shaking the phone will <xliff:g id="action">%s</xliff:g></string>
<!-- Summary texts for shake and flip actions -->
- <string name="action_summary_snooze">snooze alarm</string>
- <string name="action_summary_dismiss">dismiss alarm</string>
+ <string name="action_summary_snooze">snooze the alarm</string>
+ <string name="action_summary_dismiss">dismiss the alarm</string>
<string name="action_summary_do_nothing">do nothing</string>
<!-- Alarm picker dialog title -->
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index 11ea29484..28e65f062 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -70,27 +70,27 @@
android:entryValues="@array/volume_button_setting_values"
android:defaultValue="0" />
- <CheckBoxPreference
- android:key="show_status_bar_icon"
- android:title="@string/show_status_bar_icon_title"
- android:summary="@string/show_status_bar_icon_summary"
- android:persistent="false"
- android:defaultValue="true" />
-
<ListPreference
android:key="flip_action"
android:title="@string/flip_action_title"
- android:dialogTitle="@string/flip_action_dialog_title"
- android:entries="@array/action_summary_entries"
- android:entryValues="@array/action_summary_values"
+ android:dialogTitle="@string/flip_action_title"
+ android:entries="@array/volume_button_setting_entries"
+ android:entryValues="@array/volume_button_setting_values"
android:defaultValue="0" />
<ListPreference
android:key="shake_action"
android:title="@string/shake_action_title"
- android:dialogTitle="@string/shake_action_dialog_title"
- android:entries="@array/action_summary_entries"
- android:entryValues="@array/action_summary_values"
- android:defaultValue="0"/>
+ android:dialogTitle="@string/shake_action_title"
+ android:entries="@array/volume_button_setting_entries"
+ android:entryValues="@array/volume_button_setting_values"
+ android:defaultValue="0" />
+
+ <CheckBoxPreference
+ android:key="show_status_bar_icon"
+ android:title="@string/show_status_bar_icon_title"
+ android:summary="@string/show_status_bar_icon_summary"
+ android:persistent="false"
+ android:defaultValue="true" />
</PreferenceCategory>
</PreferenceScreen>
diff --git a/src/com/android/deskclock/SettingsActivity.java b/src/com/android/deskclock/SettingsActivity.java
index 1a3786577..8764636bc 100644
--- a/src/com/android/deskclock/SettingsActivity.java
+++ b/src/com/android/deskclock/SettingsActivity.java
@@ -191,8 +191,7 @@ public class SettingsActivity extends PreferenceActivity
notifyHomeTimeZoneChanged();
} else if (KEY_VOLUME_BUTTONS.equals(pref.getKey())) {
final ListPreference listPref = (ListPreference) pref;
- final int idx = listPref.findIndexOfValue((String) newValue);
- listPref.setSummary(listPref.getEntries()[idx]);
+ updateActionSummary(listPref, (String) newValue, R.string.volume_buttons_summary);
} else if (KEY_FLIP_ACTION.equals(pref.getKey())) {
final ListPreference listPref = (ListPreference) pref;
updateActionSummary(listPref, (String) newValue, R.string.flip_action_summary);
@@ -260,7 +259,7 @@ public class SettingsActivity extends PreferenceActivity
listPref.setSummary(listPref.getEntry());
listPref = (ListPreference) findPreference(KEY_VOLUME_BUTTONS);
- listPref.setSummary(listPref.getEntry());
+ updateActionSummary(listPref, listPref.getValue(), R.string.volume_buttons_summary);
listPref.setOnPreferenceChangeListener(this);
listPref = (ListPreference) findPreference(KEY_FLIP_ACTION);