use of org.omnirom.deskclock.preference.AutoSilencePickerPreference in project android_packages_apps_OmniClock by omnirom.
the class SettingsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(Utils.getThemeResourceId(this));
getWindow().getDecorView().setBackgroundColor(Utils.getViewBackgroundColor(this));
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
getActionBar().setDisplayHomeAsUpEnabled(true);
// We don't want to reconstruct the timezone list every single time
// onResume() is called so we do it once in onCreate
ListPreference listPref;
listPref = (ListPreference) findPreference(KEY_HOME_TZ);
if (mTimezones == null) {
mTime = System.currentTimeMillis();
mTimezones = getAllTimezones();
}
listPref.setEntryValues(mTimezones[0]);
listPref.setEntries(mTimezones[1]);
listPref.setSummary(listPref.getEntry());
listPref.setOnPreferenceChangeListener(this);
mTimerAlarmPref = (RingtonePreference) findPreference(KEY_TIMER_ALARM);
mTimerAlarmPref.setOnPreferenceChangeListener(this);
mSnoozeMinutes = (NumberPickerPreference) findPreference(KEY_ALARM_SNOOZE_MINUTES);
mSnoozeMinutes.setValue(Utils.getSnoozeTimeoutValue(this));
mSnoozeMinutes.setMinValue(1);
mSnoozeMinutes.setMaxValue(30);
mSnoozeMinutes.setSummary(getSnoozedMinutes(mSnoozeMinutes.getValue()));
mSnoozeMinutes.setOnPreferenceChangeListener(this);
mSilenceMinutes = (AutoSilencePickerPreference) findPreference(KEY_ALARM_SILENCE_AFTER);
mSilenceMinutes.setValue(Utils.getTimeoutValue(this));
mSilenceMinutes.setMinValue(1);
mSilenceMinutes.setMaxValue(30);
updateSilenceAfterSummary(mSilenceMinutes, mSilenceMinutes.getValue());
mSilenceMinutes.setOnPreferenceChangeListener(this);
addSettings();
if (!getResources().getBoolean(R.bool.config_disableSensorOnWirelessCharging)) {
Preference p = findPreference(KEY_ALARM_ACTION_WIRELESS_HEADER);
PreferenceCategory alarmActionsCategory = (PreferenceCategory) findPreference(KEY_ALARM_ACTION_CATEGORY);
alarmActionsCategory.removePreference(p);
}
}
Aggregations