diff options
author | Andrew Lee <anwlee@google.com> | 2015-02-26 17:20:12 -0800 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-02-27 11:39:39 -0800 |
commit | e94b9454cb8baf31034af05dc797cdfffb04e308 (patch) | |
tree | a82d55062550bb9d5d9e98e1d34595328ef35370 /res | |
parent | bf6baa4a0b44166a9b336c1e7d29a69446c0ca8a (diff) |
Cleanup SoundSettingsFragment.
+ No functional change, but cleaner / more robust code.
+ Converted preference keys into shared string constants.
+ Reorganized code in SoundSettingsFragment into clearer helpers.
+ Defined constants for "magic" values used for sound preferences.
Bug: 19372734
Change-Id: Ic0eb44d72548909ae6c520b18e0f4e2a2d013ac6
Diffstat (limited to 'res')
-rw-r--r-- | res/values/strings.xml | 7 | ||||
-rw-r--r-- | res/xml/sound_settings.xml | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 1e7a48b2d..db134430e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -716,4 +716,11 @@ <!-- Label for the phone account settings [CHAR LIMIT=30] --> <string name="phone_account_settings_label">Calling accounts</string> + + <!-- DO NOT TRANSLATE. Internal key for ringtone preference. --> + <string name="ringtone_preference_key" translatable="false">button_ringtone_key</string> + <!-- DO NOT TRANSLATE. Internal key for vibrate when ringing preference. --> + <string name="vibrate_on_preference_key" translatable="false">button_vibrate_on_ring</string> + <!-- DO NOT TRANSLATE. Internal key for vibrate when ringing preference. --> + <string name="play_dtmf_preference_key" translatable="false">button_play_dtmf_tone</string> </resources> diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml index e933eedc0..ebe0f51f1 100644 --- a/res/xml/sound_settings.xml +++ b/res/xml/sound_settings.xml @@ -19,20 +19,20 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <com.android.dialer.settings.DefaultRingtonePreference - android:key="button_ringtone_key" + android:key="@string/ringtone_preference_key" android:title="@string/ringtone_title" android:dialogTitle="@string/ringtone_title" android:persistent="false" android:ringtoneType="ringtone" /> <CheckBoxPreference - android:key="button_play_dtmf_tone" + android:key="@string/play_dtmf_preference_key" android:title="@string/dtmf_tone_enable_title" android:persistent="false" android:defaultValue="true" /> <CheckBoxPreference - android:key="button_vibrate_on_ring" + android:key="@string/vibrate_on_preference_key" android:title="@string/vibrate_on_ring_title" android:persistent="false" android:defaultValue="false" /> |