Update content description

Test: manual: use TalkBack on conversations screen
Fixes: 317316662
Change-Id: I7c9b0746bf610168e8a3c2bc0d2932082da221a8
This commit is contained in:
Julia Reynolds
2024-01-02 15:24:59 -05:00
parent 89ea9597ea
commit e6c3d18648
2 changed files with 8 additions and 1 deletions

View File

@@ -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();