Snap for 9625236 from 27d53afa8d to tm-qpr3-release
Change-Id: I1e22d9cbf7a8ffd7026e07da21c85c51c7c17f0a
This commit is contained in:
@@ -137,6 +137,10 @@
|
|||||||
|
|
||||||
<uses-library android:name="org.apache.http.legacy" />
|
<uses-library android:name="org.apache.http.legacy" />
|
||||||
|
|
||||||
|
<property
|
||||||
|
android:name="android.window.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED"
|
||||||
|
android:value="true" />
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<activity android:name=".homepage.SettingsHomepageActivity"
|
<activity android:name=".homepage.SettingsHomepageActivity"
|
||||||
android:label="@string/settings_label_launcher"
|
android:label="@string/settings_label_launcher"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -673,4 +673,20 @@
|
|||||||
|
|
||||||
<!-- Whether to display the 3G option at network mode.-->
|
<!-- Whether to display the 3G option at network mode.-->
|
||||||
<bool name="config_display_network_mode_3g_option">true</bool>
|
<bool name="config_display_network_mode_3g_option">true</bool>
|
||||||
|
|
||||||
|
<!-- The illustration for those screen are not in one of below type. This file should be a video in JSON format. -->
|
||||||
|
<item name="a11y_timeout_banner" type="raw" product="default">@raw/accessibility_timeout_banner</item>
|
||||||
|
<item name="a11y_timeout_banner" type="raw" product="tablet">@raw/accessibility_timeout_banner_tablet</item>
|
||||||
|
|
||||||
|
<item name="a11y_shortcut_type_triple_tap" type="raw" product="default">@raw/accessibility_shortcut_type_triple_tap</item>
|
||||||
|
<item name="a11y_shortcut_type_triple_tap" type="raw" product="tablet">@raw/accessibility_shortcut_type_triple_tap_tablet</item>
|
||||||
|
|
||||||
|
<item name="a11y_color_inversion_banner" type="raw" product="default">@raw/accessibility_color_inversion_banner</item>
|
||||||
|
<item name="a11y_color_inversion_banner" type="raw" product="tablet">@raw/accessibility_color_inversion_banner_tablet</item>
|
||||||
|
|
||||||
|
<item name="a11y_magnification_banner" type="raw" product="default">@raw/accessibility_magnification_banner</item>
|
||||||
|
<item name="a11y_magnification_banner" type="raw" product="tablet">@raw/accessibility_magnification_banner_tablet</item>
|
||||||
|
|
||||||
|
<item name="a11y_extra_dim_banner" type="raw" product="default">@raw/extra_dim_banner</item>
|
||||||
|
<item name="a11y_extra_dim_banner" type="raw" product="tablet">@raw/extra_dim_banner_tablet</item>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
58
res/values/drawables.xml
Normal file
58
res/values/drawables.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2023 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<drawable name="a11y_shortcut_type_software_gesture_talkback" product="default">@drawable/accessibility_shortcut_type_software_gesture_talkback</drawable>
|
||||||
|
<drawable name="a11y_shortcut_type_software_gesture_talkback" product="tablet">@drawable/accessibility_shortcut_type_software_gesture_talkback_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_button_preview_base" product="default">@drawable/accessibility_button_preview_base</drawable>
|
||||||
|
<drawable name="a11y_button_preview_base" product="tablet">@drawable/accessibility_button_preview_base_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_button_preview_large_floating_menu" product="default">@drawable/accessibility_button_preview_large_floating_menu</drawable>
|
||||||
|
<drawable name="a11y_button_preview_large_floating_menu" product="tablet">@drawable/accessibility_button_preview_large_floating_menu_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_button_preview_small_floating_menu" product="default">@drawable/accessibility_button_preview_small_floating_menu</drawable>
|
||||||
|
<drawable name="a11y_button_preview_small_floating_menu" product="tablet">@drawable/accessibility_button_preview_small_floating_menu_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_button_preview_three_finger" product="default">@drawable/accessibility_button_preview_three_finger</drawable>
|
||||||
|
<drawable name="a11y_button_preview_three_finger" product="tablet">@drawable/accessibility_button_preview_three_finger_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_button_preview_two_finger" product="default">@drawable/accessibility_button_preview_two_finger</drawable>
|
||||||
|
<drawable name="a11y_button_preview_two_finger" product="tablet">@drawable/accessibility_button_preview_two_finger_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_captioning_banner" product="default">@drawable/accessibility_captioning_banner</drawable>
|
||||||
|
<drawable name="a11y_captioning_banner" product="tablet">@drawable/accessibility_captioning_banner_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_shortcut_type_hardware" product="default">@drawable/accessibility_shortcut_type_hardware</drawable>
|
||||||
|
<drawable name="a11y_shortcut_type_hardware" product="tablet">@drawable/accessibility_shortcut_type_hardware_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_shortcut_type_software" product="default">@drawable/accessibility_shortcut_type_software</drawable>
|
||||||
|
<drawable name="a11y_shortcut_type_software" product="tablet">@drawable/accessibility_shortcut_type_software_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_shortcut_type_software_floating" product="default">@drawable/accessibility_shortcut_type_software_floating</drawable>
|
||||||
|
<drawable name="a11y_shortcut_type_software_floating" product="tablet">@drawable/accessibility_shortcut_type_software_floating_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_shortcut_type_software_gesture" product="default">@drawable/accessibility_shortcut_type_software_gesture</drawable>
|
||||||
|
<drawable name="a11y_shortcut_type_software_gesture" product="tablet">@drawable/accessibility_shortcut_type_software_gesture_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_magnification_mode_fullscreen" product="default">@drawable/accessibility_magnification_mode_fullscreen</drawable>
|
||||||
|
<drawable name="a11y_magnification_mode_fullscreen" product="tablet">@drawable/accessibility_magnification_mode_fullscreen_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_magnification_mode_switch" product="default">@drawable/accessibility_magnification_mode_switch</drawable>
|
||||||
|
<drawable name="a11y_magnification_mode_switch" product="tablet">@drawable/accessibility_magnification_mode_switch_tablet</drawable>
|
||||||
|
|
||||||
|
<drawable name="a11y_magnification_mode_window" product="default">@drawable/accessibility_magnification_mode_window</drawable>
|
||||||
|
<drawable name="a11y_magnification_mode_window" product="tablet">@drawable/accessibility_magnification_mode_window_tablet</drawable>
|
||||||
|
</resources>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<com.android.settingslib.widget.IllustrationPreference
|
<com.android.settingslib.widget.IllustrationPreference
|
||||||
android:key="accessibility_control_timeout_banner"
|
android:key="accessibility_control_timeout_banner"
|
||||||
settings:lottie_rawRes="@raw/accessibility_timeout_banner"/>
|
settings:lottie_rawRes="@raw/a11y_timeout_banner"/>
|
||||||
|
|
||||||
<com.android.settingslib.widget.SelectorWithWidgetPreference
|
<com.android.settingslib.widget.SelectorWithWidgetPreference
|
||||||
android:key="accessibility_control_timeout_default"
|
android:key="accessibility_control_timeout_default"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
android:key="captions_preview"
|
android:key="captions_preview"
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:selectable="false"
|
android:selectable="false"
|
||||||
settings:lottie_rawRes="@drawable/accessibility_captions_banner"
|
settings:lottie_rawRes="@drawable/a11y_captioning_banner"
|
||||||
settings:searchable="false" />
|
settings:searchable="false" />
|
||||||
|
|
||||||
<com.android.settings.widget.SettingsMainSwitchPreference
|
<com.android.settings.widget.SettingsMainSwitchPreference
|
||||||
|
|||||||
@@ -111,15 +111,15 @@ public class AccessibilityButtonPreviewPreferenceController extends BasePreferen
|
|||||||
final int opacity = (int) (Settings.Secure.getFloat(mContentResolver,
|
final int opacity = (int) (Settings.Secure.getFloat(mContentResolver,
|
||||||
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY, DEFAULT_OPACITY) * 100);
|
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY, DEFAULT_OPACITY) * 100);
|
||||||
final int floatingMenuIconId = (size == SMALL_SIZE)
|
final int floatingMenuIconId = (size == SMALL_SIZE)
|
||||||
? R.drawable.accessibility_button_preview_small_floating_menu
|
? R.drawable.a11y_button_preview_small_floating_menu
|
||||||
: R.drawable.accessibility_button_preview_large_floating_menu;
|
: R.drawable.a11y_button_preview_large_floating_menu;
|
||||||
mIllustrationPreference.setImageDrawable(
|
mIllustrationPreference.setImageDrawable(
|
||||||
getAccessibilityPreviewDrawable(floatingMenuIconId, opacity));
|
getAccessibilityPreviewDrawable(floatingMenuIconId, opacity));
|
||||||
} else if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
|
} else if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
|
||||||
mIllustrationPreference.setImageDrawable(mContext.getDrawable(
|
mIllustrationPreference.setImageDrawable(mContext.getDrawable(
|
||||||
AccessibilityUtil.isTouchExploreEnabled(mContext)
|
AccessibilityUtil.isTouchExploreEnabled(mContext)
|
||||||
? R.drawable.accessibility_button_preview_three_finger
|
? R.drawable.a11y_button_preview_three_finger
|
||||||
: R.drawable.accessibility_button_preview_two_finger));
|
: R.drawable.a11y_button_preview_two_finger));
|
||||||
} else {
|
} else {
|
||||||
mIllustrationPreference.setImageDrawable(
|
mIllustrationPreference.setImageDrawable(
|
||||||
mContext.getDrawable(R.drawable.accessibility_button_navigation));
|
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 context A valid context
|
||||||
* @param editShortcutDialog Need to be a type of edit shortcut dialog
|
* @param editShortcutDialog Need to be a type of edit shortcut dialog
|
||||||
* @return True if the update is successful
|
* @return True if the update is successful
|
||||||
*/
|
*/
|
||||||
public static boolean updateSoftwareShortcutInDialog(Context context,
|
public static boolean updateShortcutInDialog(Context context,
|
||||||
Dialog editShortcutDialog) {
|
Dialog editShortcutDialog) {
|
||||||
final View container = editShortcutDialog.findViewById(R.id.container_layout);
|
final View container = editShortcutDialog.findViewById(R.id.container_layout);
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
initSoftwareShortcut(context, container);
|
initSoftwareShortcut(context, container);
|
||||||
|
initHardwareShortcut(context, container);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -340,7 +341,7 @@ public class AccessibilityDialogUtils {
|
|||||||
final CharSequence summary = context.getText(
|
final CharSequence summary = context.getText(
|
||||||
R.string.accessibility_shortcut_edit_dialog_summary_hardware);
|
R.string.accessibility_shortcut_edit_dialog_summary_hardware);
|
||||||
setupShortcutWidget(dialogView, title, summary,
|
setupShortcutWidget(dialogView, title, summary,
|
||||||
R.drawable.accessibility_shortcut_type_hardware);
|
R.drawable.a11y_shortcut_type_hardware);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initMagnifyShortcut(Context context, View view) {
|
private static void initMagnifyShortcut(Context context, View view) {
|
||||||
@@ -354,7 +355,7 @@ public class AccessibilityDialogUtils {
|
|||||||
summary = MessageFormat.format(summary, arguments);
|
summary = MessageFormat.format(summary, arguments);
|
||||||
|
|
||||||
setupShortcutWidgetWithImageRawResource(context, dialogView, title, summary,
|
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) {
|
private static void initAdvancedWidget(View view) {
|
||||||
@@ -409,13 +410,13 @@ public class AccessibilityDialogUtils {
|
|||||||
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
||||||
int resId;
|
int resId;
|
||||||
if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
|
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)) {
|
} else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
|
||||||
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
||||||
? R.drawable.accessibility_shortcut_type_software_gesture_talkback
|
? R.drawable.a11y_shortcut_type_software_gesture_talkback
|
||||||
: R.drawable.accessibility_shortcut_type_software_gesture;
|
: R.drawable.a11y_shortcut_type_software_gesture;
|
||||||
} else {
|
} else {
|
||||||
resId = R.drawable.accessibility_shortcut_type_software;
|
resId = R.drawable.a11y_shortcut_type_software;
|
||||||
}
|
}
|
||||||
return resId;
|
return resId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ public final class AccessibilityGestureNavigationTutorial {
|
|||||||
final CharSequence title =
|
final CharSequence title =
|
||||||
context.getText(R.string.accessibility_tutorial_dialog_title_volume);
|
context.getText(R.string.accessibility_tutorial_dialog_title_volume);
|
||||||
final View image =
|
final View image =
|
||||||
createIllustrationView(context, R.drawable.accessibility_shortcut_type_hardware);
|
createIllustrationView(context, R.drawable.a11y_shortcut_type_hardware);
|
||||||
final ImageView indicatorIcon =
|
final ImageView indicatorIcon =
|
||||||
createImageView(context, R.drawable.ic_accessibility_page_indicator);
|
createImageView(context, R.drawable.ic_accessibility_page_indicator);
|
||||||
final CharSequence instruction =
|
final CharSequence instruction =
|
||||||
@@ -396,7 +396,7 @@ public final class AccessibilityGestureNavigationTutorial {
|
|||||||
context.getText(R.string.accessibility_tutorial_dialog_title_triple);
|
context.getText(R.string.accessibility_tutorial_dialog_title_triple);
|
||||||
final View image =
|
final View image =
|
||||||
createIllustrationViewWithImageRawResource(context,
|
createIllustrationViewWithImageRawResource(context,
|
||||||
R.raw.accessibility_shortcut_type_triple_tap);
|
R.raw.a11y_shortcut_type_triple_tap);
|
||||||
final CharSequence instruction =
|
final CharSequence instruction =
|
||||||
context.getText(R.string.accessibility_tutorial_dialog_message_triple);
|
context.getText(R.string.accessibility_tutorial_dialog_message_triple);
|
||||||
final ImageView indicatorIcon =
|
final ImageView indicatorIcon =
|
||||||
@@ -428,13 +428,13 @@ public final class AccessibilityGestureNavigationTutorial {
|
|||||||
private static View createSoftwareImage(Context context) {
|
private static View createSoftwareImage(Context context) {
|
||||||
int resId;
|
int resId;
|
||||||
if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
|
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)) {
|
} else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
|
||||||
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
resId = AccessibilityUtil.isTouchExploreEnabled(context)
|
||||||
? R.drawable.accessibility_shortcut_type_software_gesture_talkback
|
? R.drawable.a11y_shortcut_type_software_gesture_talkback
|
||||||
: R.drawable.accessibility_shortcut_type_software_gesture;
|
: R.drawable.a11y_shortcut_type_software_gesture;
|
||||||
} else {
|
} else {
|
||||||
resId = R.drawable.accessibility_shortcut_type_software;
|
resId = R.drawable.a11y_shortcut_type_software;
|
||||||
}
|
}
|
||||||
return createIllustrationView(context, resId);
|
return createIllustrationView(context, resId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class AccessibilityLayerDrawable extends LayerDrawable {
|
|||||||
*/
|
*/
|
||||||
public static AccessibilityLayerDrawable createLayerDrawable(Context context, int resId,
|
public static AccessibilityLayerDrawable createLayerDrawable(Context context, int resId,
|
||||||
int opacity) {
|
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(
|
final AccessibilityLayerDrawable basicDrawable = new AccessibilityLayerDrawable(
|
||||||
new Drawable[]{bg, null});
|
new Drawable[]{bg, null});
|
||||||
|
|
||||||
|
|||||||
@@ -88,15 +88,15 @@ public class MagnificationModePreferenceController extends BasePreferenceControl
|
|||||||
private void initModeInfos() {
|
private void initModeInfos() {
|
||||||
mModeInfos.add(new MagnificationModeInfo(mContext.getText(
|
mModeInfos.add(new MagnificationModeInfo(mContext.getText(
|
||||||
R.string.accessibility_magnification_mode_dialog_option_full_screen), null,
|
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(
|
mModeInfos.add(new MagnificationModeInfo(
|
||||||
mContext.getText(R.string.accessibility_magnification_mode_dialog_option_window),
|
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(
|
mModeInfos.add(new MagnificationModeInfo(
|
||||||
mContext.getText(R.string.accessibility_magnification_mode_dialog_option_switch),
|
mContext.getText(R.string.accessibility_magnification_mode_dialog_option_switch),
|
||||||
mContext.getText(
|
mContext.getText(
|
||||||
R.string.accessibility_magnification_area_settings_mode_switch_summary),
|
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
|
@Override
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePrefere
|
|||||||
mTopIntroTitle = getText(R.string.accessibility_display_inversion_preference_intro_text);
|
mTopIntroTitle = getText(R.string.accessibility_display_inversion_preference_intro_text);
|
||||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||||
.authority(getPrefContext().getPackageName())
|
.authority(getPrefContext().getPackageName())
|
||||||
.appendPath(String.valueOf(R.raw.accessibility_color_inversion_banner))
|
.appendPath(String.valueOf(R.raw.a11y_color_inversion_banner))
|
||||||
.build();
|
.build();
|
||||||
final View view = super.onCreateView(inflater, container, savedInstanceState);
|
final View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
updateFooterPreference();
|
updateFooterPreference();
|
||||||
|
|||||||
@@ -833,14 +833,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
if (mDialog == null || !mDialog.isShowing()) {
|
if (mDialog == null || !mDialog.isShowing()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
AccessibilityDialogUtils.updateShortcutInDialog(getContext(), mDialog);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
|
|||||||
|
|
||||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||||
.authority(getPrefContext().getPackageName())
|
.authority(getPrefContext().getPackageName())
|
||||||
.appendPath(String.valueOf(R.raw.extra_dim_banner))
|
.appendPath(String.valueOf(R.raw.a11y_extra_dim_banner))
|
||||||
.build();
|
.build();
|
||||||
mComponentName = REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
|
mComponentName = REDUCE_BRIGHT_COLORS_COMPONENT_NAME;
|
||||||
mPackageName = getText(R.string.reduce_bright_colors_preference_title);
|
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);
|
mPackageName = getString(R.string.accessibility_screen_magnification_title);
|
||||||
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
mImageUri = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
||||||
.authority(getPrefContext().getPackageName())
|
.authority(getPrefContext().getPackageName())
|
||||||
.appendPath(String.valueOf(R.raw.accessibility_magnification_banner))
|
.appendPath(String.valueOf(R.raw.a11y_magnification_banner))
|
||||||
.build();
|
.build();
|
||||||
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
|
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
|
||||||
removeDialog(DialogEnums.EDIT_SHORTCUT);
|
removeDialog(DialogEnums.EDIT_SHORTCUT);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import androidx.window.embedding.ActivityFilter;
|
import androidx.window.embedding.ActivityFilter;
|
||||||
import androidx.window.embedding.ActivityRule;
|
import androidx.window.embedding.ActivityRule;
|
||||||
|
import androidx.window.embedding.EmbeddingAspectRatio;
|
||||||
import androidx.window.embedding.RuleController;
|
import androidx.window.embedding.RuleController;
|
||||||
import androidx.window.embedding.SplitAttributes;
|
import androidx.window.embedding.SplitAttributes;
|
||||||
import androidx.window.embedding.SplitPairFilter;
|
import androidx.window.embedding.SplitPairFilter;
|
||||||
@@ -110,6 +111,7 @@ public class ActivityEmbeddingRulesController {
|
|||||||
.setClearTop(clearTop)
|
.setClearTop(clearTop)
|
||||||
.setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp())
|
.setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp())
|
||||||
.setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp())
|
.setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp())
|
||||||
|
.setMaxAspectRatioInPortrait(EmbeddingAspectRatio.alwaysAllow())
|
||||||
.setDefaultSplitAttributes(attributes)
|
.setDefaultSplitAttributes(attributes)
|
||||||
.build();
|
.build();
|
||||||
RuleController.getInstance(context).addRule(splitPairRule);
|
RuleController.getInstance(context).addRule(splitPairRule);
|
||||||
@@ -230,6 +232,7 @@ public class ActivityEmbeddingRulesController {
|
|||||||
activityFilters, intent)
|
activityFilters, intent)
|
||||||
.setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp())
|
.setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp())
|
||||||
.setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp())
|
.setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp())
|
||||||
|
.setMaxAspectRatioInPortrait(EmbeddingAspectRatio.alwaysAllow())
|
||||||
.setSticky(false)
|
.setSticky(false)
|
||||||
.setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ADJACENT)
|
.setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ADJACENT)
|
||||||
.setDefaultSplitAttributes(attributes)
|
.setDefaultSplitAttributes(attributes)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class AccessibilityButtonPreviewPreferenceControllerTest {
|
|||||||
|
|
||||||
final Drawable smallFloatingMenuWithTenOpacityDrawable =
|
final Drawable smallFloatingMenuWithTenOpacityDrawable =
|
||||||
AccessibilityLayerDrawable.createLayerDrawable(mContext,
|
AccessibilityLayerDrawable.createLayerDrawable(mContext,
|
||||||
R.drawable.accessibility_button_preview_small_floating_menu, 10);
|
R.drawable.a11y_button_preview_small_floating_menu, 10);
|
||||||
assertThat(
|
assertThat(
|
||||||
mController.mIllustrationPreference.getImageDrawable().getConstantState())
|
mController.mIllustrationPreference.getImageDrawable().getConstantState())
|
||||||
.isEqualTo(smallFloatingMenuWithTenOpacityDrawable.getConstantState());
|
.isEqualTo(smallFloatingMenuWithTenOpacityDrawable.getConstantState());
|
||||||
|
|||||||
@@ -43,20 +43,20 @@ public class AccessibilityDialogUtilsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateSoftwareShortcutInDialog_correctDialogType_success() {
|
public void updateShortcutInDialog_correctDialogType_success() {
|
||||||
final AlertDialog dialog = AccessibilityDialogUtils.showEditShortcutDialog(
|
final AlertDialog dialog = AccessibilityDialogUtils.showEditShortcutDialog(
|
||||||
mContext, AccessibilityDialogUtils.DialogType.EDIT_SHORTCUT_GENERIC, "Title",
|
mContext, AccessibilityDialogUtils.DialogType.EDIT_SHORTCUT_GENERIC, "Title",
|
||||||
null);
|
null);
|
||||||
|
|
||||||
assertThat(
|
assertThat(
|
||||||
AccessibilityDialogUtils.updateSoftwareShortcutInDialog(mContext, dialog)).isTrue();
|
AccessibilityDialogUtils.updateShortcutInDialog(mContext, dialog)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateSoftwareShortcutInDialog_useNotSupportedDialog_fail() {
|
public void updateShortcutInDialog_useNotSupportedDialog_fail() {
|
||||||
final AlertDialog dialog = new AlertDialog.Builder(mContext).setTitle("Title").show();
|
final AlertDialog dialog = new AlertDialog.Builder(mContext).setTitle("Title").show();
|
||||||
|
|
||||||
assertThat(AccessibilityDialogUtils.updateSoftwareShortcutInDialog(mContext,
|
assertThat(AccessibilityDialogUtils.updateShortcutInDialog(mContext,
|
||||||
dialog)).isFalse();
|
dialog)).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class AccessibilityLayerDrawableTest {
|
|||||||
@Test
|
@Test
|
||||||
public void createLayerDrawable_configCorrect() {
|
public void createLayerDrawable_configCorrect() {
|
||||||
final Drawable expected1stDrawable = mContext.getDrawable(
|
final Drawable expected1stDrawable = mContext.getDrawable(
|
||||||
R.drawable.accessibility_button_preview_base);
|
R.drawable.a11y_button_preview_base);
|
||||||
final Drawable expected2ndDrawable = mContext.getDrawable(TEST_RES_ID);
|
final Drawable expected2ndDrawable = mContext.getDrawable(TEST_RES_ID);
|
||||||
|
|
||||||
final AccessibilityLayerDrawable actualDrawable =
|
final AccessibilityLayerDrawable actualDrawable =
|
||||||
|
|||||||
Reference in New Issue
Block a user