Fix RTL text in TransitionLayout

Fixes: 159656380
Test: manual - video attached to bug
Change-Id: Ic676c69f3bd5072900563947efc3656a5b22ce70
This commit is contained in:
Jeff DeCew
2020-06-22 20:17:23 -04:00
parent 6452044f56
commit 4636fbc163
4 changed files with 42 additions and 46 deletions

View File

@@ -65,25 +65,16 @@
<!-- Actions must be ordered left-to-right even in RTL layout. However, they appear in a chain
with the album art and the title, and must as a group appear at the end of that chain. This is
accomplished by having the guidebox (an invisible view that is positioned around all 5 actions)
in the chain with the album art and the title. The actions are in a LTR chain bounded by that
guidebox, and the ambiguity of how wide the guidebox should be is resolved by using a barrier
which forces it's starting edge to be as far to the end as possible while fitting the actions.
-->
accomplished by having all actions appear in a LTR chain within the parent, and then biasing it
to the right side, then this barrier is used to bound the text views. -->
<androidx.constraintlayout.widget.Barrier
android:id="@+id/media_action_barrier"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:barrierDirection="start"
/>
<View
android:id="@+id/media_action_guidebox"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginTop="16dp"
android:visibility="invisible"
app:constraint_referenced_ids="action0,action1,action2,action3,action4"
/>
<ImageButton
@@ -201,7 +192,6 @@
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
android:singleLine="true"
android:textColor="@color/media_primary_text"
android:textDirection="locale"
android:textSize="16sp" />
<!-- Artist name -->
@@ -212,7 +202,6 @@
android:fontFamily="@*android:string/config_headlineFontFamily"
android:singleLine="true"
android:textColor="@color/media_secondary_text"
android:textDirection="locale"
android:textSize="14sp" />
<com.android.internal.widget.CachingIconView

View File

@@ -85,10 +85,11 @@
<!-- Song name -->
<Constraint
android:id="@+id/header_title"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:layout_marginStart="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintTop_toBottomOf="@id/app_name"
app:layout_constraintBottom_toTopOf="@id/header_artist"
app:layout_constraintStart_toEndOf="@id/album_art"
@@ -98,10 +99,11 @@
<!-- Artist name -->
<Constraint
android:id="@+id/header_artist"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginBottom="24dp"
app:layout_constrainedWidth="true"
app:layout_constraintTop_toBottomOf="@id/header_title"
app:layout_constraintStart_toStartOf="@id/header_title"
app:layout_constraintEnd_toStartOf="@id/media_action_barrier"
@@ -134,27 +136,6 @@
android:visibility="gone"
/>
<Constraint
android:id="@+id/media_action_barrier"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:barrierDirection="start"
app:constraint_referenced_ids="media_action_guidebox,action0,action1,action2,action3,action4"
/>
<Constraint
android:id="@+id/media_action_guidebox"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginTop="18dp"
android:visibility="invisible"
app:layout_constraintTop_toBottomOf="@id/app_name"
app:layout_constraintStart_toEndOf="@id/header_title"
app:layout_constraintEnd_toEndOf="parent"
/>
<Constraint
android:id="@+id/action0"
android:layout_width="48dp"
@@ -165,8 +146,9 @@
android:visibility="gone"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintTop_toBottomOf="@id/app_name"
app:layout_constraintLeft_toLeftOf="@id/media_action_guidebox"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/action1"
app:layout_constraintHorizontal_bias="1"
>
</Constraint>
@@ -220,7 +202,8 @@
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintTop_toBottomOf="@id/app_name"
app:layout_constraintLeft_toRightOf="@id/action3"
app:layout_constraintRight_toRightOf="@id/media_action_guidebox"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_bias="0"
>
</Constraint>
</ConstraintSet>

View File

@@ -83,11 +83,12 @@
<!-- Song name -->
<Constraint
android:id="@+id/header_title"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
android:layout_marginTop="17dp"
android:layout_marginStart="16dp"
app:layout_constrainedWidth="true"
app:layout_constraintTop_toBottomOf="@+id/app_name"
app:layout_constraintStart_toEndOf="@id/album_art"
app:layout_constraintEnd_toEndOf="parent"
@@ -96,10 +97,11 @@
<!-- Artist name -->
<Constraint
android:id="@+id/header_artist"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
android:layout_marginTop="3dp"
app:layout_constrainedWidth="true"
app:layout_constraintTop_toBottomOf="@id/header_title"
app:layout_constraintStart_toStartOf="@id/header_title"
app:layout_constraintEnd_toEndOf="parent"