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

Commit fb020a0f authored by Shawn Lee's avatar Shawn Lee
Browse files

Add custom accessibility description for notif section headers

Bug: 379270258
Test: manually verified using TalkBack
Flag: EXEMPT bugfix
Change-Id: I10abfb1f1ad7ca8ca7d297e5b32efdf325b5c5b3
parent 5755c77f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1509,6 +1509,9 @@
    <!-- Content description for accessibility: Tapping this button will dismiss all gentle notifications [CHAR LIMIT=NONE] -->
    <string name="accessibility_notification_section_header_gentle_clear_all">Clear all silent notifications</string>

    <!-- Content description for accessibility: Tapping this button will open notifications settings [CHAR LIMIT=NONE] -->
    <string name="accessibility_notification_section_header_open_settings">Open notifications settings</string>

    <!-- The text to show in the notifications shade when dnd is suppressing notifications. [CHAR LIMIT=100] -->
    <string name="dnd_suppressing_shade_text">Notifications paused by Do Not Disturb</string>

+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.notification.stack;

import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK;

import android.annotation.ColorInt;
import android.annotation.Nullable;
import android.annotation.StringRes;
@@ -28,6 +30,8 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.core.view.ViewCompat;

import com.android.systemui.res.R;
import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;

@@ -69,6 +73,13 @@ public class SectionHeaderView extends StackScrollerDecorView {
            mLabelView.setText(mLabelTextId);
        }
        mLabelView.setAccessibilityHeading(true);
        ViewCompat.replaceAccessibilityAction(
                mLabelView,
                ACTION_CLICK,
                getResources().getString(
                        R.string.accessibility_notification_section_header_open_settings),
                null
        );
    }

    @Override