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

Commit 9ec6673b authored by marcusge's avatar marcusge
Browse files

[Accessibility] Color Contrast address talkback bugs

Test: local raven device
Bug: 329352987
Bug: 329192396
Bug: 329187057
Flag: aconfig
com.android.settings.accessibility.enable_color_contrast_control

Change-Id: I60d2b23acb2e406db15f348ba7881577e55a8868
parent 05f42b52
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/color_contrast_preview_background"
    android:importantForAccessibility="no"
    android:paddingLeft="24dp"
    android:paddingRight="24dp"
    android:paddingBottom="24dp">
+7 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
    android:layout_height="wrap_content">

    <FrameLayout
        android:contentDescription="@string/color_contrast_preview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingVertical="@dimen/settingslib_illustration_padding"
@@ -44,12 +45,12 @@
            android:layout_weight="1"/>

        <LinearLayout
            android:id="@+id/contrast_button_default"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <FrameLayout
                android:id="@+id/contrast_button_default"
                android:layout_width="@dimen/contrast_button_total_size"
                android:layout_height="@dimen/contrast_button_total_size"
                android:background="@drawable/accessibility_contrast_button_background">
@@ -58,7 +59,7 @@
                    android:layout_gravity="center"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/contrast_default"
                    android:contentDescription="@null"
                    android:src="@drawable/ic_contrast_standard"/>
            </FrameLayout>

@@ -79,12 +80,12 @@
            android:layout_height="match_parent" />

        <LinearLayout
            android:id="@+id/contrast_button_medium"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <FrameLayout
                android:id="@+id/contrast_button_medium"
                android:layout_width="@dimen/contrast_button_total_size"
                android:layout_height="@dimen/contrast_button_total_size"
                android:background="@drawable/accessibility_contrast_button_background">
@@ -93,7 +94,7 @@
                    android:layout_gravity="center"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/contrast_medium"
                    android:contentDescription="@null"
                    android:src="@drawable/ic_contrast_medium"/>
            </FrameLayout>

@@ -114,12 +115,12 @@
            android:layout_height="match_parent" />

        <LinearLayout
            android:id="@+id/contrast_button_high"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <FrameLayout
                android:id="@+id/contrast_button_high"
                android:layout_width="@dimen/contrast_button_total_size"
                android:layout_height="@dimen/contrast_button_total_size"
                android:background="@drawable/accessibility_contrast_button_background">
@@ -128,7 +129,7 @@
                    android:layout_gravity="center"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:contentDescription="@string/contrast_high"
                    android:contentDescription="@null"
                    android:src="@drawable/ic_contrast_high"/>
            </FrameLayout>

+2 −0
Original line number Diff line number Diff line
@@ -4695,6 +4695,8 @@
    <string name="color_contrast_preview_email_body">For further assistance, please reach out to myself or Helen. This report will be</string>
    <!-- Preview screen email attachment name on the contrast page. [CHAR LIMIT=30]  -->
    <string name="color_contrast_preview_email_attachment_name">Client Expenses</string>
    <!-- Title for color_contrast page footer. [CHAR LIMIT=30] -->
    <string name="color_contrast_about_title">About color contrast</string>
    <!-- Title for the accessibility text options page. [CHAR LIMIT=50] -->
    <string name="accessibility_turn_screen_darker_title">Turn screen darker</string>
    <!-- Title for the accessibility preference category of interaction control services and settings. [CHAR LIMIT=50] -->
+4 −2
Original line number Diff line number Diff line
@@ -39,8 +39,10 @@
            "com.android.settings.accessibility.HighTextContrastPreferenceController" />

    <com.android.settings.accessibility.AccessibilityFooterPreference
        android:key="color_contrast_footer"
        android:title="@string/color_contrast_note"
        android:selectable="false"
        settings:searchable="false"/>
        settings:searchable="false"
        settings:controller="com.android.settings.accessibility.ColorContrastFooterPreferenceController" />

</PreferenceScreen>
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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.
 */

package com.android.settings.accessibility;

import android.content.Context;

import androidx.annotation.NonNull;

import com.android.settings.R;

/** Preference controller for footer in color contrast page. */
public class ColorContrastFooterPreferenceController extends
        AccessibilityFooterPreferenceController {
    public ColorContrastFooterPreferenceController(@NonNull Context context,
            @NonNull String key) {
        super(context, key);
    }

    @Override
    protected String getIntroductionTitle() {
        return mContext.getString(R.string.color_contrast_about_title);
    }
}
Loading