From ee2e653ebb03c550c57edacd35b499673cc25e0b Mon Sep 17 00:00:00 2001 From: mcarare Date: Fri, 23 Apr 2021 18:33:52 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/19213: Adjust synced tabs to properly show in RTL. --- .../main/java/org/mozilla/fenix/sync/SyncedTabsViewHolder.kt | 2 +- app/src/main/res/layout/view_synced_tabs_group.xml | 1 + .../java/org/mozilla/fenix/sync/SyncedTabsViewHolderTest.kt | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/sync/SyncedTabsViewHolder.kt b/app/src/main/java/org/mozilla/fenix/sync/SyncedTabsViewHolder.kt index 375cec1e63..3b45a1e66d 100644 --- a/app/src/main/java/org/mozilla/fenix/sync/SyncedTabsViewHolder.kt +++ b/app/src/main/java/org/mozilla/fenix/sync/SyncedTabsViewHolder.kt @@ -87,7 +87,7 @@ sealed class SyncedTabsViewHolder(itemView: View) : RecyclerView.ViewHolder(item } itemView.synced_tabs_group_name.text = device.device.displayName - itemView.synced_tabs_group_name.setCompoundDrawablesWithIntrinsicBounds( + itemView.synced_tabs_group_name.setCompoundDrawablesRelativeWithIntrinsicBounds( deviceLogoDrawable, 0, 0, diff --git a/app/src/main/res/layout/view_synced_tabs_group.xml b/app/src/main/res/layout/view_synced_tabs_group.xml index fe0083253e..91abefcc53 100644 --- a/app/src/main/res/layout/view_synced_tabs_group.xml +++ b/app/src/main/res/layout/view_synced_tabs_group.xml @@ -22,6 +22,7 @@ android:textAppearance="@style/Header14TextStyle" android:textColor="@color/primary_text_normal_theme" android:textSize="12sp" + android:textDirection="locale" app:drawableStartCompat="@drawable/mozac_ic_device_desktop" app:drawableTint="@color/primary_text_normal_theme" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/test/java/org/mozilla/fenix/sync/SyncedTabsViewHolderTest.kt b/app/src/test/java/org/mozilla/fenix/sync/SyncedTabsViewHolderTest.kt index 3f8b06fd25..a69ba5d4fc 100644 --- a/app/src/test/java/org/mozilla/fenix/sync/SyncedTabsViewHolderTest.kt +++ b/app/src/test/java/org/mozilla/fenix/sync/SyncedTabsViewHolderTest.kt @@ -101,7 +101,7 @@ class SyncedTabsViewHolderTest { verify { deviceViewGroupName.text = "Charcoal" } verify { - deviceViewGroupName.setCompoundDrawablesWithIntrinsicBounds( + deviceViewGroupName.setCompoundDrawablesRelativeWithIntrinsicBounds( R.drawable.mozac_ic_device_desktop, 0, 0, 0 ) } @@ -117,7 +117,7 @@ class SyncedTabsViewHolderTest { verify { deviceViewGroupName.text = "Emerald" } verify { - deviceViewGroupName.setCompoundDrawablesWithIntrinsicBounds( + deviceViewGroupName.setCompoundDrawablesRelativeWithIntrinsicBounds( R.drawable.mozac_ic_device_mobile, 0, 0, 0 ) }