Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c47a7cb1 authored by Wesley.CW Wang's avatar Wesley.CW Wang
Browse files

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
parent b3c2a0dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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"
+12 −0
Original line number Diff line number Diff line
@@ -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>

+12 −0
Original line number Diff line number Diff line
@@ -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);