Fix incorrect layout in RTL
Fix illustration and the textview alginment. The imageview doesn't change the direction of the drawable, so we change scale type based on layout direction. Bug: 187526643 Test: manually test with with locale ur and en Change-Id: Ie4544f0eb00309a6132e4b6d794ad2a76966133c
This commit is contained in:
@@ -61,6 +61,12 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
|
||||
}
|
||||
final ImageView image = root.findViewById(R.id.image);
|
||||
image.setImageResource(item.mDrawableId);
|
||||
if (getContext().getResources().getConfiguration().getLayoutDirection()
|
||||
== View.LAYOUT_DIRECTION_LTR) {
|
||||
image.setScaleType(ImageView.ScaleType.FIT_START);
|
||||
} else {
|
||||
image.setScaleType(ImageView.ScaleType.FIT_END);
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user