Use FooterPreference in xml explicitly
Removed the FooterPreferenceMixin from the some accessibility pages. Fixes: 139455988 Test: manual test Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility Change-Id: Ia1568e0a120eede26fadc16764caef2ecfb2411a
This commit is contained in:
@@ -80,8 +80,6 @@ public class AccessibilityShortcutPreferenceFragment extends ToggleFeaturePrefer
|
||||
((Boolean) o) ? 1 : 0);
|
||||
return true;
|
||||
});
|
||||
mFooterPreferenceMixin.createFooterPreference()
|
||||
.setTitle(R.string.accessibility_shortcut_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,7 +184,8 @@ public class AccessibilityShortcutPreferenceFragment extends ToggleFeaturePrefer
|
||||
return getServiceInfo(context) != null;
|
||||
}
|
||||
|
||||
private static @Nullable ComponentName getShortcutComponent(Context context) {
|
||||
private static @Nullable
|
||||
ComponentName getShortcutComponent(Context context) {
|
||||
String componentNameString = AccessibilityUtils.getShortcutTargetServiceComponentNameString(
|
||||
context, UserHandle.myUserId());
|
||||
if (componentNameString == null) return null;
|
||||
|
@@ -77,8 +77,9 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
/**
|
||||
* Gets string that should be used as a autoclick preference summary for provided autoclick
|
||||
* delay.
|
||||
*
|
||||
* @param resources Resources from which string should be retrieved.
|
||||
* @param delay Delay for whose value summary should be retrieved.
|
||||
* @param delay Delay for whose value summary should be retrieved.
|
||||
*/
|
||||
static CharSequence getAutoclickPreferenceSummary(Resources resources, int delay) {
|
||||
int summaryIndex = getAutoclickPreferenceSummaryIndex(delay);
|
||||
@@ -136,8 +137,6 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
mDelay.setMax(delayToSeekBarProgress(MAX_AUTOCLICK_DELAY));
|
||||
mDelay.setProgress(delayToSeekBarProgress(delay));
|
||||
mDelay.setOnPreferenceChangeListener(this);
|
||||
mFooterPreferenceMixin.createFooterPreference()
|
||||
.setTitle(R.string.accessibility_autoclick_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,11 +165,11 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (preference == mDelay && newValue instanceof Integer) {
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
|
||||
seekBarProgressToDelay((int)newValue));
|
||||
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
|
||||
seekBarProgressToDelay((int) newValue));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,6 +43,7 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
|
||||
private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED;
|
||||
private static final String TYPE = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER;
|
||||
private static final int DEFAULT_TYPE = AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY;
|
||||
private static final String KEY_DALTONIZER_FOOTER = "daltonizer_footer";
|
||||
|
||||
private ListPreference mType;
|
||||
|
||||
@@ -62,10 +63,8 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
|
||||
|
||||
mType = (ListPreference) findPreference("type");
|
||||
|
||||
if (!ColorDisplayManager.isColorTransformAccelerated(getActivity())) {
|
||||
mFooterPreferenceMixin.createFooterPreference().setTitle(
|
||||
R.string.accessibility_display_daltonizer_preference_subtitle);
|
||||
}
|
||||
final Preference footer = findPreference(KEY_DALTONIZER_FOOTER);
|
||||
footer.setVisible(!ColorDisplayManager.isColorTransformAccelerated(getActivity()));
|
||||
initPreferences();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user