use of android.support.v7.preference.CheckBoxPreference in project android_packages_apps_Settings by crdroidandroid.
the class ApplicationSettings method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.application_settings);
mToggleAdvancedSettings = (CheckBoxPreference) findPreference(KEY_TOGGLE_ADVANCED_SETTINGS);
mToggleAdvancedSettings.setChecked(isAdvancedSettingsEnabled());
getPreferenceScreen().removePreference(mToggleAdvancedSettings);
// not ready for prime time yet
if (false) {
getPreferenceScreen().removePreference(mInstallLocation);
}
mInstallLocation = (ListPreference) findPreference(KEY_APP_INSTALL_LOCATION);
// Is app default install location set?
boolean userSetInstLocation = (Settings.Global.getInt(getContentResolver(), Settings.Global.SET_INSTALL_LOCATION, 0) != 0);
if (!userSetInstLocation) {
getPreferenceScreen().removePreference(mInstallLocation);
} else {
mInstallLocation.setValue(getAppInstallLocation());
mInstallLocation.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
String value = (String) newValue;
handleUpdateAppInstallLocation(value);
return false;
}
});
}
}
use of android.support.v7.preference.CheckBoxPreference in project sms-backup-plus by jberkel.
the class MainSettings method updateAutoBackupPreferences.
private void updateAutoBackupPreferences() {
final CheckBoxPreference autoBackup = findAutoBackupPreference();
autoBackup.setSummary(summarizeAutoBackupSettings());
autoBackup.setEnabled(!authPreferences.useXOAuth() || authPreferences.hasOAuth2Tokens());
final Preference autoBackupSettings = findPreference(BACKUP_SETTINGS_SCREEN.key);
autoBackupSettings.setSummary(summarizeBackupScheduleSettings(autoBackup.isChecked()));
autoBackupSettings.setEnabled(autoBackup.isEnabled() && autoBackup.isChecked());
}
use of android.support.v7.preference.CheckBoxPreference in project Pix-Art-Messenger by kriztan.
the class SettingsActivity method enableMultiAccounts.
private void enableMultiAccounts() {
if (!isMultiAccountChecked) {
multiAccountPreference.setEnabled(true);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
builder.setTitle(R.string.pref_enable_multi_accounts_title);
builder.setMessage(R.string.pref_enable_multi_accounts_summary);
builder.setNegativeButton(R.string.cancel, (dialog, which) -> {
((CheckBoxPreference) multiAccountPreference).setChecked(false);
});
builder.setPositiveButton(R.string.enter_password, (dialog, which) -> {
((CheckBoxPreference) multiAccountPreference).setChecked(false);
enterPasswordDialog();
});
AlertDialog dialog = builder.create();
dialog.show();
}
}
use of android.support.v7.preference.CheckBoxPreference in project android_packages_apps_CMParts by LineageOS.
the class DisplayRotation method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
addPreferencesFromResource(R.xml.display_rotation);
PreferenceScreen prefSet = getPreferenceScreen();
mAccelerometer = (SwitchPreference) findPreference(KEY_ACCELEROMETER);
mAccelerometer.setPersistent(false);
mRotation0Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_0_PREF);
mRotation90Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_90_PREF);
mRotation180Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_180_PREF);
mRotation270Pref = (CheckBoxPreference) prefSet.findPreference(ROTATION_270_PREF);
int mode = Settings.System.getInt(getContentResolver(), Settings.System.ACCELEROMETER_ROTATION_ANGLES, ROTATION_0_MODE | ROTATION_90_MODE | ROTATION_270_MODE);
mRotation0Pref.setChecked((mode & ROTATION_0_MODE) != 0);
mRotation90Pref.setChecked((mode & ROTATION_90_MODE) != 0);
mRotation180Pref.setChecked((mode & ROTATION_180_MODE) != 0);
mRotation270Pref.setChecked((mode & ROTATION_270_MODE) != 0);
watch(Settings.System.getUriFor(Settings.System.ACCELEROMETER_ROTATION));
}
use of android.support.v7.preference.CheckBoxPreference in project android_packages_apps_Settings by SudaMod.
the class ApplicationSettings method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.application_settings);
mToggleAdvancedSettings = (CheckBoxPreference) findPreference(KEY_TOGGLE_ADVANCED_SETTINGS);
mToggleAdvancedSettings.setChecked(isAdvancedSettingsEnabled());
getPreferenceScreen().removePreference(mToggleAdvancedSettings);
// not ready for prime time yet
if (false) {
getPreferenceScreen().removePreference(mInstallLocation);
}
mInstallLocation = (ListPreference) findPreference(KEY_APP_INSTALL_LOCATION);
// Is app default install location set?
boolean userSetInstLocation = (Settings.Global.getInt(getContentResolver(), Settings.Global.SET_INSTALL_LOCATION, 0) != 0);
if (!userSetInstLocation) {
getPreferenceScreen().removePreference(mInstallLocation);
} else {
mInstallLocation.setValue(getAppInstallLocation());
mInstallLocation.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
String value = (String) newValue;
handleUpdateAppInstallLocation(value);
return false;
}
});
}
}
Aggregations