From e6c3d18648c46a1b6025689fa1e5189ff4764e4a Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 2 Jan 2024 15:24:59 -0500 Subject: [PATCH] Update content description Test: manual: use TalkBack on conversations screen Fixes: 317316662 Change-Id: I7c9b0746bf610168e8a3c2bc0d2932082da221a8 --- res/values/strings.xml | 3 +++ .../notification/app/RecentConversationPreference.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6f389ba7713..acf4321aebd 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -8212,6 +8212,9 @@ Clear + + Clear %1$s + Priority and modified conversations will appear here diff --git a/src/com/android/settings/notification/app/RecentConversationPreference.java b/src/com/android/settings/notification/app/RecentConversationPreference.java index 167fdd61650..b60810af324 100644 --- a/src/com/android/settings/notification/app/RecentConversationPreference.java +++ b/src/com/android/settings/notification/app/RecentConversationPreference.java @@ -28,7 +28,7 @@ import com.google.common.annotations.VisibleForTesting; public class RecentConversationPreference extends TwoTargetPreference { private OnClearClickListener mOnClearClickListener; - + private final Context mContext; private View mClearView; public interface OnClearClickListener { @@ -37,6 +37,7 @@ public class RecentConversationPreference extends TwoTargetPreference { public RecentConversationPreference(Context context) { super(context); + mContext = context; } public void setOnClearClickListener( @@ -70,6 +71,9 @@ public class RecentConversationPreference extends TwoTargetPreference { final View widgetFrame = view.findViewById(android.R.id.widget_frame); widgetFrame.setVisibility(mOnClearClickListener != null ? View.VISIBLE : View.GONE); mClearView = view.findViewById(getClearId()); + mClearView.setContentDescription( + mContext.getString(R.string.clear_conversation, getTitle())); + mClearView.setOnClickListener(v -> { if (mOnClearClickListener != null) { mOnClearClickListener.onClear();