Merge "Hide "Magnify with button" if no navbar is shown" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
65523b9cb0
@@ -389,6 +389,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
// Display magnification.
|
||||
mDisplayMagnificationPreferenceScreen = findPreference(
|
||||
DISPLAY_MAGNIFICATION_PREFERENCE_SCREEN);
|
||||
configureMagnificationPreferenceIfNeeded(mDisplayMagnificationPreferenceScreen);
|
||||
|
||||
// Font size.
|
||||
mFontSizePreferenceScreen = findPreference(FONT_SIZE_PREFERENCE_SCREEN);
|
||||
@@ -682,6 +683,19 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
||||
}
|
||||
}
|
||||
|
||||
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(ToggleScreenMagnificationPreferenceFragment.class.getName());
|
||||
final Bundle extras = preference.getExtras();
|
||||
MagnificationPreferenceFragment.populateMagnificationGesturesPreferenceExtras(extras,
|
||||
context);
|
||||
}
|
||||
}
|
||||
|
||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||
new BaseSearchIndexProvider() {
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user