summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWesley.CW Wang <wesleycwwang@google.com>2020-07-08 17:28:18 +0800
committerWesley.CW Wang <wesleycwwang@google.com>2020-07-08 17:28:18 +0800
commitc47a7cb138e4c88a88ddf45d8d9f3374ed476e15 (patch)
tree91edde7639cedda558c95094197102f496189309
parentb3c2a0dd242bbaab71636bd6d4fdf2efaad5744b (diff)
downloadThemePicker-c47a7cb138e4c88a88ddf45d8d9f3374ed476e15.tar.gz
Adjust custom theme flow preview page's a11y set
- Change part of the preview layout to not import for a11y, make it won't be focused by TB - Add new content description to each preview layout video: https://drive.google.com/file/d/1JTZCv7bdRuvzbYbxJXU-yBto4UcivijA/view?usp=sharing Fixes: 160760041 Test: manually Change-Id: I70df6d74bb39f75641b8200f5ea505d9c21d2b11
-rw-r--r--res/layout/theme_component_preview.xml2
-rwxr-xr-xres/values/strings.xml12
-rw-r--r--src/com/android/customization/model/theme/custom/ThemeComponentOption.java12
3 files changed, 26 insertions, 0 deletions
diff --git a/res/layout/theme_component_preview.xml b/res/layout/theme_component_preview.xml
index 43b8bf14..bf3255d1 100644
--- a/res/layout/theme_component_preview.xml
+++ b/res/layout/theme_component_preview.xml
@@ -48,6 +48,7 @@
android:layout_gravity="center_horizontal"
android:drawablePadding="@dimen/theme_preview_header_drawable_padding"
android:textAppearance="@style/CardTitleTextAppearance"
+ android:importantForAccessibility="no"
app:layout_constraintBottom_toTopOf="@id/theme_preview_card_body_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
@@ -64,6 +65,7 @@
android:layout_marginHorizontal="8dp"
android:layout_marginTop="@dimen/preview_theme_content_margin"
android:clipChildren="false"
+ android:importantForAccessibility="noHideDescendants"
app:layout_constraintBottom_toTopOf="@+id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_max="@dimen/preview_theme_content_max_height"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b4ec8355..d12b05ef 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -52,6 +52,18 @@
<!-- Content description of grid preview card. [CHAR_LIMIT=30]-->
<string name="grid_preview_card_content_description">Grid preview</string>
+ <!-- Content description of font preview. [CHAR_LIMIT=30]-->
+ <string name="font_preview_content_description">Font preview</string>
+
+ <!-- Content description of icon preview. [CHAR_LIMIT=30]-->
+ <string name="icon_preview_content_description">Icon preview</string>
+
+ <!-- Content description of color preview. [CHAR_LIMIT=30]-->
+ <string name="color_preview_content_description">Color preview</string>
+
+ <!-- Content description of shape preview. [CHAR_LIMIT=30]-->
+ <string name="shape_preview_content_description">Shape preview</string>
+
<!-- Content description indicating that the selected option is currently applied to the device. [CHAR_LIMIT=NONE] -->
<string name="option_applied_description"><xliff:g name="style_name">%1$s</xliff:g>, currently applied</string>
diff --git a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
index f93be44d..5922f5cb 100644
--- a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
+++ b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
@@ -138,6 +138,9 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC
@Override
public void bindPreview(ViewGroup container) {
+ container.setContentDescription(
+ container.getContext().getString(R.string.font_preview_content_description));
+
bindPreviewHeader(container, R.string.preview_name_font, R.drawable.ic_font);
ViewGroup cardBody = container.findViewById(R.id.theme_preview_card_body_container);
@@ -225,6 +228,9 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC
@Override
public void bindPreview(ViewGroup container) {
+ container.setContentDescription(
+ container.getContext().getString(R.string.icon_preview_content_description));
+
bindPreviewHeader(container, R.string.preview_name_icon, R.drawable.ic_wifi_24px);
ViewGroup cardBody = container.findViewById(R.id.theme_preview_card_body_container);
@@ -355,6 +361,9 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC
@Override
public void bindPreview(ViewGroup container) {
+ container.setContentDescription(
+ container.getContext().getString(R.string.color_preview_content_description));
+
bindPreviewHeader(container, R.string.preview_name_color, R.drawable.ic_colorize_24px);
ViewGroup cardBody = container.findViewById(R.id.theme_preview_card_body_container);
@@ -495,6 +504,9 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC
@Override
public void bindPreview(ViewGroup container) {
+ container.setContentDescription(
+ container.getContext().getString(R.string.shape_preview_content_description));
+
bindPreviewHeader(container, R.string.preview_name_shape, R.drawable.ic_shapes_24px);
ViewGroup cardBody = container.findViewById(R.id.theme_preview_card_body_container);