Maginfy Improvement

Implements the magnify new accessbility settings UI,
including the setupwizard and a11y settings

Bug: 146019459
Test: make RunSettingsRoboTests2
Change-Id: If11849a539c7841e2db495b63132e6d02b7285c0
This commit is contained in:
menghanli
2020-01-07 16:27:36 +08:00
parent 875727c2ab
commit f3eb2de691
5 changed files with 85 additions and 95 deletions

View File

@@ -49,7 +49,6 @@ public class AccessibilitySettingsForSetupWizard extends SettingsPreferenceFragm
"screen_magnification_preference";
private static final String SCREEN_READER_PREFERENCE = "screen_reader_preference";
private static final String SELECT_TO_SPEAK_PREFERENCE = "select_to_speak_preference";
private static final String FONT_SIZE_PREFERENCE = "font_size_preference";
// Package names and service names used to identify screen reader and SelectToSpeak services.
private static final String SCREEN_READER_PACKAGE_NAME = "com.google.android.marvin.talkback";
@@ -175,16 +174,11 @@ public class AccessibilitySettingsForSetupWizard extends SettingsPreferenceFragm
}
private static void configureMagnificationPreferenceIfNeeded(Preference preference) {
// Some devices support only a single magnification mode. In these cases, we redirect to
// the magnification mode's UI directly, rather than showing a PreferenceScreen with a
// single list item.
final Context context = preference.getContext();
if (!MagnificationPreferenceFragment.isApplicable(context.getResources())) {
preference.setFragment(
ToggleScreenMagnificationPreferenceFragmentForSetupWizard.class.getName());
final Bundle extras = preference.getExtras();
MagnificationGesturesPreferenceController
.populateMagnificationGesturesPreferenceExtras(extras, context);
}
preference.setFragment(
ToggleScreenMagnificationPreferenceFragmentForSetupWizard.class.getName());
final Bundle extras = preference.getExtras();
MagnificationGesturesPreferenceController
.populateMagnificationGesturesPreferenceExtras(extras, context);
}
}