Follow O patterns for a11y settings

Move the summary for the toggled features to a footer.
Make the settings appear as a preference.

Bug: 36780887
Test: Start settings and observe the new UI looks a lot
like the mocks referenced in the bug. Also added unit
test to verify that summary text shows up.

Change-Id: I1d002b194991d0901ecb27198ba5de73bd23a5a9
This commit is contained in:
Phil Weaver
2017-05-22 16:57:11 -07:00
parent 8e0754e84c
commit ed5f0951f8
7 changed files with 107 additions and 70 deletions

View File

@@ -211,6 +211,18 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
private DevicePolicyManager mDpm;
/**
* Check if the color transforms are color accelerated. Some transforms are experimental only
* on non-accelerated platforms due to the performance implications.
*
* @param context The current context
* @return
*/
public static boolean isColorTransformAccelerated(Context context) {
return context.getResources()
.getBoolean(com.android.internal.R.bool.config_setColorTransformAccelerated);
}
@Override
public int getMetricsCategory() {
return MetricsEvent.ACCESSIBILITY;
@@ -618,11 +630,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
updateAccessibilityShortcut(mAccessibilityShortcutPreferenceScreen);
}
private boolean isColorTransformAccelerated(Context context) {
return context.getResources()
.getBoolean(com.android.internal.R.bool.config_setColorTransformAccelerated);
}
private void updateMagnificationSummary(Preference pref) {
final boolean tripleTapEnabled = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 0) == 1;