Merge "Improve Talkback for user select dialog" into tm-dev am: fe0c66dc78
am: 0b599d7dd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18131628 Change-Id: I0bbc0e207bd47065a2e77c978222818c5a99a0d7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -15,9 +15,9 @@
|
|||||||
-->
|
-->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@android:id/widget_frame"
|
|
||||||
android:layout_width="120dp"
|
android:layout_width="120dp"
|
||||||
android:layout_height="112dp">
|
android:layout_height="112dp"
|
||||||
|
android:importantForAccessibility="no">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/button"
|
android:id="@+id/button"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:labelFor="@android:id/icon"
|
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
style="@style/TextAppearance.PreferenceTitle.SettingsLib"/>
|
style="@style/TextAppearance.PreferenceTitle.SettingsLib"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@@ -120,7 +120,7 @@ public class UserAdapter extends BaseAdapter {
|
|||||||
private void bindViewHolder(ViewHolder holder, int position) {
|
private void bindViewHolder(ViewHolder holder, int position) {
|
||||||
UserDetails userDetails = getItem(position);
|
UserDetails userDetails = getItem(position);
|
||||||
holder.getIconView().setImageDrawable(userDetails.mIcon);
|
holder.getIconView().setImageDrawable(userDetails.mIcon);
|
||||||
holder.getTitleView().setText(userDetails.mTitle);
|
holder.setTitle(userDetails.mTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -206,18 +206,19 @@ public class UserAdapter extends BaseAdapter {
|
|||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
private final ImageView mIconView;
|
private final ImageView mIconView;
|
||||||
private final TextView mTitleView;
|
private final TextView mTitleView;
|
||||||
|
private final View mButtonView;
|
||||||
|
|
||||||
private ViewHolder(View view) {
|
private ViewHolder(View view) {
|
||||||
super(view);
|
super(view);
|
||||||
mIconView = view.findViewById(android.R.id.icon);
|
mIconView = view.findViewById(android.R.id.icon);
|
||||||
mTitleView = view.findViewById(android.R.id.title);
|
mTitleView = view.findViewById(android.R.id.title);
|
||||||
|
mButtonView = view.findViewById(R.id.button);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ViewHolder(View view, OnClickListener onClickListener) {
|
private ViewHolder(View view, OnClickListener onClickListener) {
|
||||||
this(view);
|
this(view);
|
||||||
View button = view.findViewById(R.id.button);
|
if (mButtonView != null) {
|
||||||
if (button != null) {
|
mButtonView.setOnClickListener(v -> onClickListener.onClick(getAdapterPosition()));
|
||||||
button.setOnClickListener(v -> onClickListener.onClick(getAdapterPosition()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,8 +226,11 @@ public class UserAdapter extends BaseAdapter {
|
|||||||
return mIconView;
|
return mIconView;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextView getTitleView() {
|
private void setTitle(CharSequence title) {
|
||||||
return mTitleView;
|
mTitleView.setText(title);
|
||||||
|
if (mButtonView != null) {
|
||||||
|
mButtonView.setContentDescription(title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user