use of com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ToggleAccessibilityServicePreferenceFragment method onInstallSwitchBarToggleSwitch.
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
if (checked) {
mSwitchBar.setCheckedInternal(false);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, false);
showDialog(DIALOG_ID_ENABLE_WARNING);
} else {
mSwitchBar.setCheckedInternal(true);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, true);
showDialog(DIALOG_ID_DISABLE_WARNING);
}
return true;
}
});
}
use of com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ToggleGlobalGesturePreferenceFragment method onInstallSwitchBarToggleSwitch.
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
mSwitchBar.setCheckedInternal(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
return false;
}
});
}
use of com.android.settings.widget.ToggleSwitch.OnBeforeCheckedChangeListener in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ToggleScreenMagnificationPreferenceFragment method onInstallSwitchBarToggleSwitch.
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
mSwitchBar.setCheckedInternal(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
return false;
}
});
}
Aggregations