RESTRICT AUTOMERGE Fix certain Accessibility Settings subpages use wrong resources am: 3fba0ee402
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21422270 Change-Id: I291a61602816049647592c17588771ece1cfcc42 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -111,15 +111,15 @@ public class AccessibilityButtonPreviewPreferenceController extends BasePreferen
|
||||
final int opacity = (int) (Settings.Secure.getFloat(mContentResolver,
|
||||
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY, DEFAULT_OPACITY) * 100);
|
||||
final int floatingMenuIconId = (size == SMALL_SIZE)
|
||||
? R.drawable.accessibility_button_preview_small_floating_menu
|
||||
: R.drawable.accessibility_button_preview_large_floating_menu;
|
||||
? R.drawable.a11y_button_preview_small_floating_menu
|
||||
: R.drawable.a11y_button_preview_large_floating_menu;
|
||||
mIllustrationPreference.setImageDrawable(
|
||||
getAccessibilityPreviewDrawable(floatingMenuIconId, opacity));
|
||||
} else if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
|
||||
mIllustrationPreference.setImageDrawable(mContext.getDrawable(
|
||||
AccessibilityUtil.isTouchExploreEnabled(mContext)
|
||||
? R.drawable.accessibility_button_preview_three_finger
|
||||
: R.drawable.accessibility_button_preview_two_finger));
|
||||
? R.drawable.a11y_button_preview_three_finger
|
||||
: R.drawable.a11y_button_preview_two_finger));
|
||||
} else {
|
||||
mIllustrationPreference.setImageDrawable(
|
||||
mContext.getDrawable(R.drawable.accessibility_button_navigation));
|
||||
|
@@ -163,17 +163,18 @@ public class AccessibilityDialogUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the software shortcut in edit shortcut dialog.
|
||||
* Updates the shortcut content in edit shortcut dialog.
|
||||
*
|
||||
* @param context A valid context
|
||||
* @param editShortcutDialog Need to be a type of edit shortcut dialog
|
||||
* @return True if the update is successful
|
||||
*/
|
||||
public static boolean updateSoftwareShortcutInDialog(Context context,
|
||||
public static boolean updateShortcutInDialog(Context context,
|
||||
Dialog editShortcutDialog) {
|
||||
final View container = editShortcutDialog.findViewById(R.id.container_layout);
|
||||
if (container != null) {
|
||||
initSoftwareShortcut(context, container);
|
||||
initHardwareShortcut(context, container);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -340,7 +341,7 @@ public class AccessibilityDialogUtils {
|
||||
final CharSequence summary = context.getText(
|
||||
R.string.accessibility_shortcut_edit_dialog_summary_hardware);
|
||||
setupShortcutWidget(dialogView, title, summary,
|
||||
R.drawable.accessibility_shortcut_type_hardware);
|
||||
R.drawable.a11y_shortcut_type_hardware);
|
||||
}
|
||||
|
||||
private static void initMagnifyShortcut(Context context, View view) {
|
||||
@@ -354,7 +355,7 @@ public class AccessibilityDialogUtils {
|
||||
summary = MessageFormat.format(summary, arguments);
|
||||
|
||||
setupShortcutWidgetWithImageRawResource(context, dialogView, title, summary,
|
||||
R.raw.accessibility_shortcut_type_triple_tap);
|
||||
R.raw.a11y_shortcut_type_triple_tap);
|
||||
}
|
||||
|
||||
private static void initAdvancedWidget(View view) {
|
||||
@@ -409,13 +410,13 @@ public class AccessibilityDialogUtils {
|
||||
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
||||
int resId;
|
||||
if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
|
||||
resId = R.drawable.accessibility_shortcut_type_software_floating;
|
||||
resId = R.drawable.a11y_shortcut_type_software_floating;
|
||||
} else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
|
||||
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
||||
? R.drawable.accessibility_shortcut_type_software_gesture_talkback
|
||||
: R.drawable.accessibility_shortcut_type_software_gesture;
|
||||
? R.drawable.a11y_shortcut_type_software_gesture_talkback
|
||||
: R.drawable.a11y_shortcut_type_software_gesture;
|
||||
} else {
|
||||
resId = R.drawable.accessibility_shortcut_type_software;
|
||||
resId = R.drawable.a11y_shortcut_type_software;
|
||||
}
|
||||
return resId;
|
||||
}
|
||||
|
@@ -381,7 +381,7 @@ public final class AccessibilityGestureNavigationTutorial {
|
||||
final CharSequence title =
|
||||
context.getText(R.string.accessibility_tutorial_dialog_title_volume);
|
||||
final View image =
|
||||
createIllustrationView(context, R.drawable.accessibility_shortcut_type_hardware);
|
||||
createIllustrationView(context, R.drawable.a11y_shortcut_type_hardware);
|
||||
final ImageView indicatorIcon =
|
||||
createImageView(context, R.drawable.ic_accessibility_page_indicator);
|
||||
final CharSequence instruction =
|
||||
@@ -396,7 +396,7 @@ public final class AccessibilityGestureNavigationTutorial {
|
||||
context.getText(R.string.accessibility_tutorial_dialog_title_triple);
|
||||
final View image =
|
||||
createIllustrationViewWithImageRawResource(context,
|
||||
R.raw.accessibility_shortcut_type_triple_tap);
|
||||
R.raw.a11y_shortcut_type_triple_tap);
|
||||
final CharSequence instruction =
|
||||
context.getText(R.string.accessibility_tutorial_dialog_message_triple);
|
||||
final ImageView indicatorIcon =
|
||||
@@ -428,13 +428,13 @@ public final class AccessibilityGestureNavigationTutorial {
|
||||
private static View createSoftwareImage(Context context) {
|
||||
int resId;
|
||||
if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
|
||||
resId = R.drawable.accessibility_shortcut_type_software_floating;
|
||||
resId = R.drawable.a11y_shortcut_type_software_floating;
|
||||
} else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
|
||||
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
||||
? R.drawable.accessibility_shortcut_type_software_gesture_talkback
|
||||
: R.drawable.accessibility_shortcut_type_software_gesture;
|
||||
? R.drawable.a11y_shortcut_type_software_gesture_talkback
|
||||
: R.drawable.a11y_shortcut_type_software_gesture;
|
||||
} else {
|
||||
resId = R.drawable.accessibility_shortcut_type_software;
|
||||
resId = R.drawable.a11y_shortcut_type_software;
|
||||
}
|
||||
return createIllustrationView(context, resId);
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ public class AccessibilityLayerDrawable extends LayerDrawable {
|
||||
*/
|
||||
public static AccessibilityLayerDrawable createLayerDrawable(Context context, int resId,
|
||||
int opacity) {
|
||||
final Drawable bg = context.getDrawable(R.drawable.accessibility_button_preview_base);
|
||||
final Drawable bg = context.getDrawable(R.drawable.a11y_button_preview_base);
|
||||
final AccessibilityLayerDrawable basicDrawable = new AccessibilityLayerDrawable(
|
||||
new Drawable[]{bg, null});
|
||||
|
||||
|
@@ -88,15 +88,15 @@ public class MagnificationModePreferenceController extends BasePreferenceControl
|
||||
private void initModeInfos() {
|
||||
mModeInfos.add(new MagnificationModeInfo(mContext.getText(
|
||||
R.string.accessibility_magnification_mode_dialog_option_full_screen), null,
|
||||
R.drawable.ic_illustration_fullscreen, MagnificationMode.FULLSCREEN));
|
||||
R.drawable.a11y_magnification_mode_fullscreen, MagnificationMode.FULLSCREEN));
|
||||
mModeInfos.add(new MagnificationModeInfo(
|
||||
mContext.getText(R.string.accessibility_magnification_mode_dialog_option_window),
|
||||
null, R.drawable.ic_illustration_window, MagnificationMode.WINDOW));
|
||||
null, R.drawable.a11y_magnification_mode_window, MagnificationMode.WINDOW));
|
||||
mModeInfos.add(new MagnificationModeInfo(
|
||||
mContext.getText(R.string.accessibility_magnification_mode_dialog_option_switch),
|
||||
mContext.getText(
|
||||
R.string.accessibility_magnification_area_settings_mode_switch_summary),
|
||||
R.drawable.ic_illustration_switch, MagnificationMode.ALL));
|
||||
R.drawable.a11y_magnification_mode_switch, MagnificationMode.ALL));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -93,7 +93,7 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
|
||||
mTopIntroTitle = getText(R.string.accessibility_display_inversion_preference_intro_text);
|
||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||
.authority(getPrefContext().getPackageName())
|
||||
.appendPath(String.valueOf(R.raw.accessibility_color_inversion_banner))
|
||||
.appendPath(String.valueOf(R.raw.a11y_color_inversion_banner))
|
||||
.build();
|
||||
final View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||
updateFooterPreference();
|
||||
|
@@ -833,14 +833,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
||||
if (mDialog == null || !mDialog.isShowing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Content in software shortcut need to be adjusted depend on the accessibility button
|
||||
// mode status which can be changed in background.
|
||||
final boolean valueChanged = mSavedAccessibilityFloatingMenuEnabled
|
||||
!= AccessibilityUtil.isFloatingMenuEnabled(getContext());
|
||||
if (valueChanged) {
|
||||
AccessibilityDialogUtils.updateSoftwareShortcutInDialog(getContext(), mDialog);
|
||||
}
|
||||
AccessibilityDialogUtils.updateShortcutInDialog(getContext(), mDialog);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
@@ -64,7 +64,7 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
|
||||
|
||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||
.authority(getPrefContext().getPackageName())
|
||||
.appendPath(String.valueOf(R.raw.extra_dim_banner))
|
||||
.appendPath(String.valueOf(R.raw.a11y_extra_dim_banner))
|
||||
.build();
|
||||
mComponentName = REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
|
||||
mPackageName = getText(R.string.reduce_bright_colors_preference_title);
|
||||
|
@@ -94,7 +94,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
|
||||
mPackageName = getString(R.string.accessibility_screen_magnification_title);
|
||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||
.authority(getPrefContext().getPackageName())
|
||||
.appendPath(String.valueOf(R.raw.accessibility_magnification_banner))
|
||||
.appendPath(String.valueOf(R.raw.a11y_magnification_banner))
|
||||
.build();
|
||||
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
|
||||
removeDialog(DialogEnums.EDIT_SHORTCUT);
|
||||
|
Reference in New Issue
Block a user