Android: Fix rtl layout on game details dialog

This commit is contained in:
Charles Lombardo 2023-01-23 22:00:56 -05:00
parent d61dbd06a6
commit 8d5967ad87
2 changed files with 130 additions and 135 deletions

View File

@ -16,29 +16,33 @@
<TextView
android:id="@+id/text_game_title"
style="@android:style/TextAppearance.Material.Headline"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:ellipsize="end"
tools:text="Rhythm Heaven Fever"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:text="Rhythm Heaven Fever" />
<TextView
android:id="@+id/text_description"
style="@android:style/TextAppearance.Material.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
tools:text="Zany rhythm action!"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_game_title" />
app:layout_constraintTop_toBottomOf="@id/text_game_title"
tools:text="Zany rhythm action!" />
<ImageView
android:id="@+id/banner"
android:layout_width="144dp"
android:layout_height="48dp"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="16dp"
tools:src="@drawable/no_banner"
app:layout_constraintStart_toStartOf="parent"
@ -48,7 +52,7 @@
android:id="@+id/divider_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/banner" />
@ -58,7 +62,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_country"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/divider_1" />
@ -68,7 +72,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_company"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_country" />
@ -78,7 +82,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_game_id"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_company" />
@ -88,67 +92,60 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_revision"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_game_id" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/label_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="end"
app:constraint_referenced_ids="label_country,label_company,label_game_id,label_revision,label_file_format,label_compression,label_block_size" />
<TextView
android:id="@+id/text_country"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="United States"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_country"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_country" />
app:layout_constraintStart_toEndOf="@+id/label_country"
tools:text="United States" />
<TextView
android:id="@+id/text_company"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="Nintendo"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_company"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_company" />
app:layout_constraintStart_toEndOf="@+id/label_company"
tools:text="Nintendo" />
<TextView
android:id="@+id/text_game_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="SOME01"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_game_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_game_id" />
app:layout_constraintStart_toEndOf="@+id/label_game_id"
tools:text="SOME01" />
<TextView
android:id="@+id/text_revision"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="0"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_revision"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_revision" />
app:layout_constraintStart_toEndOf="@+id/label_revision"
tools:text="0" />
<com.google.android.material.divider.MaterialDivider
android:id="@+id/divider_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginTop="24dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_revision" />
@ -158,7 +155,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:layout_marginEnd="@dimen/spacing_small"
android:textAlignment="viewStart"
android:text="@string/game_details_file_format"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/divider_2" />
@ -168,7 +166,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_compression"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_file_format" />
@ -178,7 +176,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_block_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_compression" />
@ -187,34 +185,34 @@
android:id="@+id/text_file_format"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="ISO (4.38 GiB)"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_file_format"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_file_format" />
app:layout_constraintStart_toEndOf="@+id/label_file_format"
tools:text="ISO (4.38 GiB)" />
<TextView
android:id="@+id/text_compression"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="No Compression"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_compression"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_compression" />
app:layout_constraintStart_toEndOf="@+id/label_compression"
tools:text="No Compression" />
<TextView
android:id="@+id/text_block_size"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
tools:text="0 B"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_block_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_block_size" />
app:layout_constraintStart_toEndOf="@+id/label_block_size"
tools:text="0 B" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -16,33 +16,36 @@
<TextView
android:id="@+id/text_game_title"
style="@android:style/TextAppearance.Material.Headline"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:ellipsize="end"
android:textColor="@android:color/black"
tools:text="Rhythm Heaven Fever"
android:textColor="@color/dolphin_onSurface"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:text="Rhythm Heaven Fever" />
<TextView
android:id="@+id/text_description"
style="@android:style/TextAppearance.Material.Caption"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@android:color/black"
tools:text="Zany rhythm action!"
android:textColor="@color/dolphin_onSurface"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_game_title" />
app:layout_constraintTop_toBottomOf="@id/text_game_title"
tools:text="Zany rhythm action!" />
<ImageView
android:id="@+id/banner"
android:layout_width="144dp"
android:layout_height="48dp"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="16dp"
android:textColor="@android:color/black"
tools:src="@drawable/no_banner"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_description" />
@ -51,8 +54,8 @@
android:id="@+id/divider_1"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="32dp"
android:background="#1F000000"
android:layout_marginTop="24dp"
android:background="@color/dolphin_onSurfaceVariant"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/banner" />
@ -62,9 +65,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_country"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/divider_1" />
@ -73,9 +76,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_company"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_country" />
@ -84,9 +87,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_game_id"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_company" />
@ -95,73 +98,66 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_revision"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_game_id" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/label_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="end"
app:constraint_referenced_ids="label_country,label_company,label_game_id,label_revision,label_file_format,label_compression,label_block_size" />
<TextView
android:id="@+id/text_country"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="United States"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_country"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_country" />
app:layout_constraintStart_toEndOf="@+id/label_country"
tools:text="United States" />
<TextView
android:id="@+id/text_company"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="Nintendo"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_company"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_company" />
app:layout_constraintStart_toEndOf="@+id/label_company"
tools:text="Nintendo" />
<TextView
android:id="@+id/text_game_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="SOME01"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_game_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_game_id" />
app:layout_constraintStart_toEndOf="@+id/label_game_id"
tools:text="SOME01" />
<TextView
android:id="@+id/text_revision"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="0"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_revision"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_revision" />
app:layout_constraintStart_toEndOf="@+id/label_revision"
tools:text="0" />
<View
android:id="@+id/divider_2"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="32dp"
android:background="#1F000000"
android:layout_marginTop="24dp"
android:background="@color/dolphin_onSurfaceVariant"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_revision" />
@ -171,9 +167,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:layout_marginEnd="@dimen/spacing_small"
android:textAlignment="viewStart"
android:text="@string/game_details_file_format"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/divider_2" />
@ -182,9 +179,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_compression"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_file_format" />
@ -193,9 +190,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/game_details_block_size"
android:textColor="@android:color/black"
android:textColor="@color/dolphin_onSurface"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/label_compression" />
@ -203,37 +200,37 @@
android:id="@+id/text_file_format"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="ISO (4.38 GiB)"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_file_format"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_file_format" />
app:layout_constraintStart_toEndOf="@+id/label_file_format"
tools:text="ISO (4.38 GiB)" />
<TextView
android:id="@+id/text_compression"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="No Compression"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_compression"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_compression" />
app:layout_constraintStart_toEndOf="@+id/label_compression"
tools:text="No Compression" />
<TextView
android:id="@+id/text_block_size"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:gravity="end"
android:textColor="@android:color/black"
tools:text="0 B"
app:layout_constraintStart_toEndOf="@id/label_barrier"
android:textAlignment="viewEnd"
android:textColor="@color/dolphin_onSurface"
android:layout_marginStart="@dimen/spacing_medlarge"
app:layout_constraintBaseline_toBaselineOf="@+id/label_block_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBaseline_toBaselineOf="@id/label_block_size" />
app:layout_constraintStart_toEndOf="@+id/label_block_size"
tools:text="0 B" />
</androidx.constraintlayout.widget.ConstraintLayout>