Improve rendering for Right-To-Left layouts

This commit is contained in:
lynxnb 2022-07-30 13:22:01 +02:00 committed by Mark Collins
parent 240e7033d7
commit bb922100cb
19 changed files with 167 additions and 145 deletions

View File

@ -27,10 +27,11 @@
android:id="@+id/game_title" android:id="@+id/game_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceListItem" android:textAppearance="?android:attr/textAppearanceListItem"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="The Legend of Zelda: Breath of the Wild" /> tools:text="The Legend of Zelda: Breath of the Wild" />
<TextView <TextView
@ -40,8 +41,8 @@
android:textAppearance="?android:attr/textAppearanceListItemSecondary" android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="@android:color/tertiary_text_light" android:textColor="@android:color/tertiary_text_light"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@id/game_title"
app:layout_constraintStart_toStartOf="@id/game_title" app:layout_constraintStart_toStartOf="@id/game_title"
app:layout_constraintTop_toBottomOf="@id/game_title"
tools:text="Nintendo" /> tools:text="Nintendo" />
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
@ -49,9 +50,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start" android:layout_gravity="start"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
app:flexWrap="wrap"
app:layout_constraintStart_toStartOf="@id/game_title" app:layout_constraintStart_toStartOf="@id/game_title"
app:layout_constraintTop_toBottomOf="@id/game_subtitle" app:layout_constraintTop_toBottomOf="@id/game_subtitle">
app:flexWrap="wrap">
<Button <Button
android:id="@+id/game_play" android:id="@+id/game_play"
@ -62,9 +63,9 @@
android:focusedByDefault="true" android:focusedByDefault="true"
android:text="@string/play" android:text="@string/play"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
app:layout_minWidth="146dp"
app:icon="@drawable/ic_play" app:icon="@drawable/ic_play"
app:iconTint="?attr/colorAccent" /> app:iconTint="?attr/colorAccent"
app:layout_minWidth="146dp" />
<Button <Button
android:id="@+id/game_pin" android:id="@+id/game_pin"
@ -72,11 +73,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
app:layout_maxWidth="55dp" android:textColor="?attr/colorAccent"
app:icon="@drawable/ic_add_home"
app:iconGravity="textStart" app:iconGravity="textStart"
app:iconPadding="0dp" app:iconPadding="0dp"
app:icon="@drawable/ic_add_home" app:layout_maxWidth="55dp" />
android:textColor="?attr/colorAccent" />
</com.google.android.flexbox.FlexboxLayout> </com.google.android.flexbox.FlexboxLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>

View File

@ -35,6 +35,7 @@
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:singleLine="true" android:singleLine="true"
android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceListItem" android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textStyle="bold" android:textStyle="bold"
@ -56,6 +57,7 @@
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:singleLine="true" android:singleLine="true"
android:textAlignment="viewStart"
android:textAppearance="?android:attr/textAppearanceListItemSecondary" android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="@android:color/white" android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="@id/icon" app:layout_constraintBottom_toBottomOf="@id/icon"

View File

@ -55,6 +55,7 @@
android:fontFamily="monospace" android:fontFamily="monospace"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="center"
android:textSize="26sp" android:textSize="26sp"
tools:text="A" /> tools:text="A" />

View File

@ -7,6 +7,7 @@
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:paddingStart="72dp" android:paddingStart="72dp"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Body2" android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
tools:text="Header" /> tools:text="Header" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/controller_item" android:id="@+id/controller_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -22,7 +23,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="marquee" android:ellipsize="marquee"
android:singleLine="true" android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem" /> android:textAppearance="?android:attr/textAppearanceListItem"
tools:text="@string/config_controller" />
<TextView <TextView
android:id="@+id/text_subtitle" android:id="@+id/text_subtitle"
@ -30,5 +32,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="10" android:maxLines="10"
android:textAppearance="?android:attr/textAppearanceListItemSecondary" android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" /> android:textColor="?android:attr/textColorSecondary"
tools:text="@string/handheld_procon" />
</LinearLayout> </LinearLayout>

View File

@ -24,15 +24,17 @@
android:id="@+id/perf_stats" android:id="@+id/perf_stats"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginLeft="@dimen/onScreenItemHorizontalMargin" android:layout_marginLeft="@dimen/onScreenItemHorizontalMargin"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:textColor="#9fffff00" /> android:textColor="#9fffff00"
tools:text="60 FPS \n16.7±1.20ms" />
<ImageButton <ImageButton
android:id="@+id/on_screen_controller_toggle" android:id="@+id/on_screen_controller_toggle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|right"
android:layout_marginRight="@dimen/onScreenItemHorizontalMargin" android:layout_marginRight="@dimen/onScreenItemHorizontalMargin"
android:background="?android:attr/actionBarItemBackground" android:background="?android:attr/actionBarItemBackground"
android:padding="8dp" android:padding="8dp"

View File

@ -26,6 +26,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp" android:layout_marginHorizontal="8dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1" android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
app:layout_constraintEnd_toStartOf="@+id/delete_button" app:layout_constraintEnd_toStartOf="@+id/delete_button"
app:layout_constraintStart_toEndOf="@id/radio_button" app:layout_constraintStart_toEndOf="@id/radio_button"
@ -39,6 +40,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1" android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp" android:textSize="14sp"
@ -55,6 +57,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1" android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp" android:textSize="14sp"
@ -70,6 +73,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="@+id/name" app:layout_constraintEnd_toEndOf="@+id/name"
app:layout_constraintStart_toStartOf="@+id/name" app:layout_constraintStart_toStartOf="@+id/name"
app:layout_constraintTop_toBottomOf="@id/vendor_driver_version" app:layout_constraintTop_toBottomOf="@id/vendor_driver_version"

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/input_dialog" android:id="@+id/input_dialog"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -24,6 +23,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="0.05" /> android:layout_weight="0.05" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -84,6 +84,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:imeOptions="flagNoExtractUi|flagNoFullscreen" android:imeOptions="flagNoExtractUi|flagNoFullscreen"
android:inputType="text" android:inputType="text"
android:textAlignment="viewStart"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>

View File

@ -45,10 +45,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autoLink="web" android:autoLink="web"
android:justificationMode="inter_word"
android:paddingHorizontal="15dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingBottom="15dp" android:paddingBottom="15dp"
android:paddingHorizontal="15dp" android:textAlignment="viewStart"
android:justificationMode="inter_word"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
tools:text="@string/mpl2_license" /> tools:text="@string/mpl2_license" />

View File

@ -20,6 +20,7 @@
android:id="@+id/errorText" android:id="@+id/errorText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="#F0FF0000" android:textColor="#F0FF0000"
android:textStyle="bold" android:textStyle="bold"
@ -30,6 +31,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:textAlignment="viewStart"
tools:text="Error" /> tools:text="Error" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View File

@ -78,10 +78,10 @@
<ImageView <ImageView
android:id="@+id/title_text" android:id="@+id/title_text"
android:layout_width="0dp" android:layout_width="85dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
android:scaleType="fitStart" android:scaleType="fitStart"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/text_title" android:id="@+id/text_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -7,6 +8,8 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold"
tools:text="NSP" />

View File

@ -86,6 +86,7 @@
android:fontFamily="monospace" android:fontFamily="monospace"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="26sp" android:textSize="26sp"
tools:text="R" /> tools:text="R" />

View File

@ -5,8 +5,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
app:elevation="0dp" android:fitsSystemWindows="true"
android:fitsSystemWindows="true"> app:elevation="0dp">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"

View File

@ -18,13 +18,13 @@
android:layout_width="22dp" android:layout_width="22dp"
android:layout_height="22dp" android:layout_height="22dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:contentDescription="@string/search"
app:srcCompat="@drawable/ic_search"
app:tint="?android:attr/textColorSecondary"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:contentDescription="@string/search"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/> app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_search"
app:tint="?android:attr/textColorSecondary" />
<EditText <EditText
android:id="@+id/search_field" android:id="@+id/search_field"