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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/errorRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/errorRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:padding="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

View File

@ -1,35 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:cardElevation="0dp"
app:cardUseCompatPadding="true"
app:strokeColor="?attr/colorOnSurface"
app:strokeWidth="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:cardElevation="0dp"
app:cardUseCompatPadding="true"
app:strokeColor="?attr/colorOnSurface"
app:strokeWidth="1dp">
android:padding="16dp">
<LinearLayout
<TextView
android:id="@+id/errorText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:textAlignment="viewStart"
android:textAllCaps="true"
android:textColor="#F0FF0000"
android:textStyle="bold"
tools:text="File" />
<TextView
android:id="@+id/errorText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:textColor="#F0FF0000"
android:textStyle="bold"
tools:text="File" />
<TextView
android:id="@+id/fileText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
tools:text="Error" />
android:id="@+id/fileText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textAlignment="viewStart"
tools:text="Error" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -78,10 +78,10 @@
<ImageView
android:id="@+id/title_text"
android:layout_width="0dp"
android:layout_width="85dp"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:contentDescription="@string/app_name"
android:scaleType="fitStart"
@ -131,6 +131,6 @@
android:layout_height="match_parent"
android:clipToPadding="false"
android:overScrollMode="ifContentScrolls"
android:paddingBottom="20dp"/>
android:paddingBottom="20dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<emu.skyline.input.onscreen.OnScreenControllerView
android:id="@+id/on_screen_controller_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/on_screen_controller_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/fab_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="16dp"
android:orientation="horizontal" />
android:id="@+id/fab_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_margin="16dp"
android:orientation="horizontal" />
</FrameLayout>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.floatingactionbutton.FloatingActionButton xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="?attr/colorPrimary"
app:fabSize="mini"
app:tint="@android:color/white"
tools:ignore="ContentDescription" />
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="?attr/colorPrimary"
app:fabSize="mini"
app:tint="@android:color/white"
tools:ignore="ContentDescription" />

View File

@ -1,90 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rumble_layout"
android:layout_width="match_parent"
android:id="@+id/rumble_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:animateLayoutChanges="true"
android:defaultFocusHighlightEnabled="false"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusedByDefault="true"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/rumble_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:animateLayoutChanges="true"
android:defaultFocusHighlightEnabled="false"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusedByDefault="true"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/rumble_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:animateLayoutChanges="true"
android:text="@string/press_any_button"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textSize="16sp" />
android:text="@string/press_any_button"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textSize="16sp" />
<RelativeLayout
android:id="@+id/rumble_controller"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:animateLayoutChanges="true"
android:gravity="center_horizontal">
android:id="@+id/rumble_controller"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:animateLayoutChanges="true"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/rumble_controller_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:alpha="0.25"
android:contentDescription="@string/controller"
android:src="@drawable/ic_controller" />
android:id="@+id/rumble_controller_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:alpha="0.25"
android:contentDescription="@string/controller"
android:src="@drawable/ic_controller" />
<TextView
android:id="@+id/rumble_controller_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/rumble_controller_icon"
android:layout_marginStart="10dp"
android:layout_marginTop="4dp"
android:layout_toEndOf="@id/rumble_controller_icon"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textSize="15sp" />
android:id="@+id/rumble_controller_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/rumble_controller_icon"
android:layout_marginStart="10dp"
android:layout_marginTop="4dp"
android:layout_toEndOf="@id/rumble_controller_icon"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textSize="15sp" />
<TextView
android:id="@+id/rumble_controller_supported"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rumble_controller_name"
android:layout_alignStart="@id/rumble_controller_name"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="@android:color/tertiary_text_light"
android:textSize="13sp" />
android:id="@+id/rumble_controller_supported"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rumble_controller_name"
android:layout_alignStart="@id/rumble_controller_name"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="@android:color/tertiary_text_light"
android:textSize="13sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="horizontal">
<Button
android:id="@+id/rumble_builtin"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
android:orientation="horizontal">
android:layout_marginEnd="10dp"
android:text="@string/builtin"
android:textColor="?attr/colorAccent"
android:visibility="gone" />
<Button
android:id="@+id/rumble_builtin"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="@string/builtin"
android:textColor="?attr/colorAccent"
android:visibility="gone" />
<Button
android:id="@+id/rumble_reset"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="@string/reset"
android:textColor="?attr/colorAccent" />
android:id="@+id/rumble_reset"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="@string/reset"
android:textColor="?attr/colorAccent" />
</LinearLayout>
</LinearLayout>

View File

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

View File

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

View File

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

View File

@ -18,13 +18,13 @@
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/search"
app:srcCompat="@drawable/ic_search"
app:tint="?android:attr/textColorSecondary"
android:layout_marginStart="16dp"
android:contentDescription="@string/search"
app:layout_constraintBottom_toBottomOf="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
android:id="@+id/search_field"