summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/accessibility')
-rw-r--r--src/com/android/settings/accessibility/CaptionPropertiesFragment.java10
-rw-r--r--src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java12
-rw-r--r--src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java2
-rw-r--r--src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java6
-rw-r--r--src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java4
-rw-r--r--src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java2
-rw-r--r--src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java4
7 files changed, 18 insertions, 22 deletions
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index 5dcf121eb..937f3b799 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -70,7 +70,6 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
private SubtitleView mPreviewText;
private View mPreviewWindow;
private SwitchBar mSwitchBar;
- private ToggleSwitch mToggleSwitch;
// Standard options.
private LocalePreference mLocale;
@@ -132,8 +131,7 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
- mToggleSwitch = mSwitchBar.getSwitch();
- mToggleSwitch.setCheckedInternal(enabled);
+ mSwitchBar.setSwitchChecked(enabled);
mPreviewWindow = view.findViewById(R.id.preview_window);
@@ -200,10 +198,10 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
}
protected void onInstallSwitchBarToggleSwitch() {
- mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
- toggleSwitch.setCheckedInternal(checked);
+ mSwitchBar.setSwitchChecked(checked);
Settings.Secure.putInt(getActivity().getContentResolver(),
Settings.Secure.ACCESSIBILITY_CAPTIONING_ENABLED, checked ? 1 : 0);
getPreferenceScreen().setEnabled(checked);
@@ -222,7 +220,7 @@ public class CaptionPropertiesFragment extends SettingsPreferenceFragment
private void removeSwitchBarToggleSwitch() {
mSwitchBar.hide();
- mToggleSwitch.setOnBeforeCheckedChangeListener(null);
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(null);
}
private void initializeAllPreferences() {
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index a446f4925..d18c7f370 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -58,7 +58,7 @@ public class ToggleAccessibilityServicePreferenceFragment
String settingValue = Settings.Secure.getString(getContentResolver(),
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
final boolean enabled = settingValue.contains(mComponentName.flattenToString());
- mToggleSwitch.setCheckedInternal(enabled);
+ mSwitchBar.setSwitchChecked(enabled);
}
};
@@ -265,13 +265,13 @@ public class ToggleAccessibilityServicePreferenceFragment
switch (which) {
case DialogInterface.BUTTON_POSITIVE:
checked = (mShownDialogId == DIALOG_ID_ENABLE_WARNING);
- mToggleSwitch.setCheckedInternal(checked);
+ mSwitchBar.setSwitchChecked(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
break;
case DialogInterface.BUTTON_NEGATIVE:
checked = (mShownDialogId == DIALOG_ID_DISABLE_WARNING);
- mToggleSwitch.setCheckedInternal(checked);
+ mSwitchBar.setSwitchChecked(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
break;
@@ -283,15 +283,15 @@ public class ToggleAccessibilityServicePreferenceFragment
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
- mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
if (checked) {
- toggleSwitch.setCheckedInternal(false);
+ mSwitchBar.setSwitchChecked(false);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, false);
showDialog(DIALOG_ID_ENABLE_WARNING);
} else {
- toggleSwitch.setCheckedInternal(true);
+ mSwitchBar.setSwitchChecked(true);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, true);
showDialog(DIALOG_ID_DISABLE_WARNING);
}
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index b910f796a..a39c5d8f1 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -80,7 +80,7 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
- mToggleSwitch.setCheckedInternal(
+ mSwitchBar.setSwitchChecked(
Settings.Secure.getInt(getContentResolver(), ENABLED, 0) == 1);
mSwitchBar.addOnSwitchChangeListener(this);
}
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 331c0e340..cc8128911 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -40,7 +40,6 @@ public abstract class ToggleFeaturePreferenceFragment
extends SettingsPreferenceFragment {
protected SwitchBar mSwitchBar;
- protected ToggleSwitch mToggleSwitch;
protected String mPreferenceKey;
protected Preference mSummaryPreference;
@@ -89,7 +88,6 @@ public abstract class ToggleFeaturePreferenceFragment
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
- mToggleSwitch = mSwitchBar.getSwitch();
onProcessArguments(getArguments());
}
@@ -132,7 +130,7 @@ public abstract class ToggleFeaturePreferenceFragment
}
private void removeActionBarToggleSwitch() {
- mToggleSwitch.setOnBeforeCheckedChangeListener(null);
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(null);
onRemoveSwitchBarToggleSwitch();
mSwitchBar.hide();
}
@@ -153,7 +151,7 @@ public abstract class ToggleFeaturePreferenceFragment
// Enabled.
if (arguments.containsKey(AccessibilitySettings.EXTRA_CHECKED)) {
final boolean enabled = arguments.getBoolean(AccessibilitySettings.EXTRA_CHECKED);
- mToggleSwitch.setCheckedInternal(enabled);
+ mSwitchBar.setSwitchChecked(enabled);
}
// Title.
diff --git a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
index 782e7a5b2..d815e5038 100644
--- a/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleGlobalGesturePreferenceFragment.java
@@ -32,10 +32,10 @@ public class ToggleGlobalGesturePreferenceFragment
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
- mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
- toggleSwitch.setCheckedInternal(checked);
+ mSwitchBar.setSwitchChecked(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
return false;
diff --git a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
index b6d5569b6..594ed2239 100644
--- a/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleInversionPreferenceFragment.java
@@ -71,7 +71,7 @@ public class ToggleInversionPreferenceFragment extends ToggleFeaturePreferenceFr
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
- mToggleSwitch.setCheckedInternal(
+ mSwitchBar.setSwitchChecked(
Settings.Secure.getInt(getContentResolver(), ENABLED, 0) == 1);
mSwitchBar.addOnSwitchChangeListener(this);
}
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 8202a2a25..7c01d0e5f 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -32,10 +32,10 @@ public class ToggleScreenMagnificationPreferenceFragment
@Override
protected void onInstallSwitchBarToggleSwitch() {
super.onInstallSwitchBarToggleSwitch();
- mToggleSwitch.setOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
+ mSwitchBar.setSwitchOnBeforeCheckedChangeListener(new OnBeforeCheckedChangeListener() {
@Override
public boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked) {
- toggleSwitch.setCheckedInternal(checked);
+ mSwitchBar.setSwitchChecked(checked);
getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, checked);
onPreferenceToggled(mPreferenceKey, checked);
return false;