Merge "a11y: Make images optional for single choice list view dialog" into main
This commit is contained in:
@@ -60,6 +60,10 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
||||
summary.setVisibility(View.GONE);
|
||||
}
|
||||
final ImageView image = root.findViewById(R.id.image);
|
||||
if (item.mDrawableId == null) {
|
||||
image.setVisibility(View.GONE);
|
||||
} else {
|
||||
image.setVisibility(View.VISIBLE);
|
||||
image.setImageResource(item.mDrawableId);
|
||||
if (getContext().getResources().getConfiguration().getLayoutDirection()
|
||||
== View.LAYOUT_DIRECTION_LTR) {
|
||||
@@ -67,6 +71,7 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
||||
} else {
|
||||
image.setScaleType(ImageView.ScaleType.FIT_END);
|
||||
}
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -78,11 +83,12 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
||||
public final CharSequence mTitle;
|
||||
@Nullable
|
||||
public final CharSequence mSummary;
|
||||
@Nullable
|
||||
@DrawableRes
|
||||
public final int mDrawableId;
|
||||
public final Integer mDrawableId;
|
||||
|
||||
public ItemInfo(@NonNull CharSequence title, @Nullable CharSequence summary,
|
||||
@DrawableRes int drawableId) {
|
||||
@Nullable @DrawableRes Integer drawableId) {
|
||||
mTitle = title;
|
||||
mSummary = summary;
|
||||
mDrawableId = drawableId;
|
||||
|
Reference in New Issue
Block a user