Moved preference strings from strings.xml to their own category file

This commit is contained in:
Phillip Hsu
2016-06-06 21:24:44 -07:00
parent a4bfce7874
commit 4b8bbcf5f2
7 changed files with 74 additions and 74 deletions
@@ -9,18 +9,6 @@ import com.philliphsu.clock2.R;
* Created by Phillip Hsu on 6/6/2016.
*/
public class SettingsActivity extends BaseActivity {
/*
* TODO: Define these keys as string resources instead and then delete these.
* TODO: Move the existing string resources for the preferences below from strings.xml to prefs.xml
*/
// World Clock preference keys
public static final String KEY_PREF_SHOW_TIME_OFFSETS_FROM = "pref_show_time_offsets_from";
// Alarms preference keys
public static final String KEY_PREF_TIME_PICKER_STYLE = "pref_time_picker_style";
public static final String KEY_PREF_SNOOZE_DURATION = "pref_snooze_duration";
public static final String KEY_PREF_FIRST_DAY_OF_WEEK = "pref_first_day_of_week";
// Timers preference keys
public static final String KEY_PREF_TIMER_RINGTONE = "pref_timer_ringtone";
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -23,8 +23,7 @@ public class SettingsFragment extends PreferenceFragment implements SharedPrefer
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
// Set ringtone summary
setSummary(getPreferenceScreen().getSharedPreferences(),
SettingsActivity.KEY_PREF_TIMER_RINGTONE);
setSummary(getPreferenceScreen().getSharedPreferences(), getString(R.string.key_timer_ringtone));
findPreference(getString(R.string.key_alarm_volume))
.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override