Merge "Create settings for window magnification (3/n)"

This commit is contained in:
Minche Li
2020-01-15 11:00:04 +00:00
committed by Android (Google) Code Review
6 changed files with 106 additions and 97 deletions

View File

@@ -257,6 +257,11 @@ public class ToggleScreenMagnificationPreferenceFragment extends
updateAlertDialogCheckState();
updateAlertDialogEnableState();
// Window magnification mode doesn't support advancedView.
if (isWindowMagnification(getPrefContext())) {
advancedView.setVisibility(View.GONE);
return;
}
// Shows the triple tap checkbox directly if clicked.
if (mTripleTapTypeCheckBox.isChecked()) {
advancedView.setVisibility(View.GONE);
@@ -614,4 +619,13 @@ public class ToggleScreenMagnificationPreferenceFragment extends
}
return false;
}
private boolean isWindowMagnification(Context context) {
final int mode = Settings.Secure.getIntForUser(
context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE,
Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN,
context.getContentResolver().getUserId());
return mode == Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW;
}
}