Update content description
Test: manual: use TalkBack on conversations screen Fixes: 317316662 Change-Id: I7c9b0746bf610168e8a3c2bc0d2932082da221a8
This commit is contained in:
@@ -8212,6 +8212,9 @@
|
|||||||
<!-- a11y string -->
|
<!-- a11y string -->
|
||||||
<string name="clear">Clear</string>
|
<string name="clear">Clear</string>
|
||||||
|
|
||||||
|
<!-- a11y string -->
|
||||||
|
<string name="clear_conversation">Clear <xliff:g id="conversation_name" example="Mom">%1$s</xliff:g></string>
|
||||||
|
|
||||||
<!-- title for conversation onboarding -->
|
<!-- title for conversation onboarding -->
|
||||||
<string name="conversation_onboarding_title">Priority and modified conversations will appear here</string>
|
<string name="conversation_onboarding_title">Priority and modified conversations will appear here</string>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|||||||
public class RecentConversationPreference extends TwoTargetPreference {
|
public class RecentConversationPreference extends TwoTargetPreference {
|
||||||
|
|
||||||
private OnClearClickListener mOnClearClickListener;
|
private OnClearClickListener mOnClearClickListener;
|
||||||
|
private final Context mContext;
|
||||||
private View mClearView;
|
private View mClearView;
|
||||||
|
|
||||||
public interface OnClearClickListener {
|
public interface OnClearClickListener {
|
||||||
@@ -37,6 +37,7 @@ public class RecentConversationPreference extends TwoTargetPreference {
|
|||||||
|
|
||||||
public RecentConversationPreference(Context context) {
|
public RecentConversationPreference(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
mContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOnClearClickListener(
|
public void setOnClearClickListener(
|
||||||
@@ -70,6 +71,9 @@ public class RecentConversationPreference extends TwoTargetPreference {
|
|||||||
final View widgetFrame = view.findViewById(android.R.id.widget_frame);
|
final View widgetFrame = view.findViewById(android.R.id.widget_frame);
|
||||||
widgetFrame.setVisibility(mOnClearClickListener != null ? View.VISIBLE : View.GONE);
|
widgetFrame.setVisibility(mOnClearClickListener != null ? View.VISIBLE : View.GONE);
|
||||||
mClearView = view.findViewById(getClearId());
|
mClearView = view.findViewById(getClearId());
|
||||||
|
mClearView.setContentDescription(
|
||||||
|
mContext.getString(R.string.clear_conversation, getTitle()));
|
||||||
|
|
||||||
mClearView.setOnClickListener(v -> {
|
mClearView.setOnClickListener(v -> {
|
||||||
if (mOnClearClickListener != null) {
|
if (mOnClearClickListener != null) {
|
||||||
mOnClearClickListener.onClear();
|
mOnClearClickListener.onClear();
|
||||||
|
|||||||
Reference in New Issue
Block a user