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);
|
summary.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
final ImageView image = root.findViewById(R.id.image);
|
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);
|
image.setImageResource(item.mDrawableId);
|
||||||
if (getContext().getResources().getConfiguration().getLayoutDirection()
|
if (getContext().getResources().getConfiguration().getLayoutDirection()
|
||||||
== View.LAYOUT_DIRECTION_LTR) {
|
== View.LAYOUT_DIRECTION_LTR) {
|
||||||
@@ -67,6 +71,7 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
|||||||
} else {
|
} else {
|
||||||
image.setScaleType(ImageView.ScaleType.FIT_END);
|
image.setScaleType(ImageView.ScaleType.FIT_END);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,11 +83,12 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
|||||||
public final CharSequence mTitle;
|
public final CharSequence mTitle;
|
||||||
@Nullable
|
@Nullable
|
||||||
public final CharSequence mSummary;
|
public final CharSequence mSummary;
|
||||||
|
@Nullable
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
public final int mDrawableId;
|
public final Integer mDrawableId;
|
||||||
|
|
||||||
public ItemInfo(@NonNull CharSequence title, @Nullable CharSequence summary,
|
public ItemInfo(@NonNull CharSequence title, @Nullable CharSequence summary,
|
||||||
@DrawableRes int drawableId) {
|
@Nullable @DrawableRes Integer drawableId) {
|
||||||
mTitle = title;
|
mTitle = title;
|
||||||
mSummary = summary;
|
mSummary = summary;
|
||||||
mDrawableId = drawableId;
|
mDrawableId = drawableId;
|
||||||
|
Reference in New Issue
Block a user