Merge "Fix incorrect layout in RTL" into sc-dev am: a2f47b3299

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14514126

Change-Id: Ia755c6d55c726cd0d421ee36789335f3735bff3c
This commit is contained in:
Ryan Lin
2021-05-13 04:31:44 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 2 deletions

View File

@@ -50,7 +50,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary" android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_alignLeft="@id/title" android:layout_alignStart="@id/title"
android:layout_below="@id/title" /> android:layout_below="@id/title" />
<ImageView <ImageView
@@ -59,6 +59,6 @@
android:layout_height="@dimen/accessibility_imageview_size" android:layout_height="@dimen/accessibility_imageview_size"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:scaleType="fitStart" android:scaleType="fitStart"
android:layout_alignLeft="@id/title" android:layout_alignStart="@id/title"
android:layout_below="@id/summary"/> android:layout_below="@id/summary"/>
</com.android.settings.widget.CheckableRelativeLayout> </com.android.settings.widget.CheckableRelativeLayout>

View File

@@ -61,6 +61,12 @@ public class ItemInfoArrayAdapter<T extends ItemInfoArrayAdapter.ItemInfo> exten
} }
final ImageView image = root.findViewById(R.id.image); final ImageView image = root.findViewById(R.id.image);
image.setImageResource(item.mDrawableId); 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; return root;
} }