diff options
| author | 2023-04-26 01:54:55 -0400 | |
|---|---|---|
| committer | 2023-06-03 00:05:55 -0700 | |
| commit | f41939b66e09d39c3a87ab53bf681738af59a893 (patch) | |
| tree | d924353dd0be7e9ec4482becfa18cc5209c408c9 /src/android | |
| parent | android: Fix setup rotation bug (diff) | |
| download | yuzu-f41939b66e09d39c3a87ab53bf681738af59a893.tar.gz yuzu-f41939b66e09d39c3a87ab53bf681738af59a893.tar.xz yuzu-f41939b66e09d39c3a87ab53bf681738af59a893.zip | |
android: Vertically scalable setup pages
Previously the setup pages would remain at a fixed height but now the icon and two text boxes will give up space as a device gets shorter. This eliminates the need for a scrolling view further problems with padding.
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/res/layout/fragment_setup.xml | 8 | ||||
| -rw-r--r-- | src/android/app/src/main/res/layout/page_setup.xml | 60 |
2 files changed, 45 insertions, 23 deletions
diff --git a/src/android/app/src/main/res/layout/fragment_setup.xml b/src/android/app/src/main/res/layout/fragment_setup.xml index adaaa4959..d7bafaea2 100644 --- a/src/android/app/src/main/res/layout/fragment_setup.xml +++ b/src/android/app/src/main/res/layout/fragment_setup.xml | |||
| @@ -10,7 +10,9 @@ | |||
| 10 | android:id="@+id/viewPager2" | 10 | android:id="@+id/viewPager2" |
| 11 | android:layout_width="0dp" | 11 | android:layout_width="0dp" |
| 12 | android:layout_height="0dp" | 12 | android:layout_height="0dp" |
| 13 | app:layout_constraintBottom_toBottomOf="parent" | 13 | android:clipToPadding="false" |
| 14 | android:layout_marginBottom="16dp" | ||
| 15 | app:layout_constraintBottom_toTopOf="@+id/button_next" | ||
| 14 | app:layout_constraintEnd_toEndOf="parent" | 16 | app:layout_constraintEnd_toEndOf="parent" |
| 15 | app:layout_constraintStart_toStartOf="parent" | 17 | app:layout_constraintStart_toStartOf="parent" |
| 16 | app:layout_constraintTop_toTopOf="parent" /> | 18 | app:layout_constraintTop_toTopOf="parent" /> |
| @@ -20,7 +22,7 @@ | |||
| 20 | android:id="@+id/button_next" | 22 | android:id="@+id/button_next" |
| 21 | android:layout_width="wrap_content" | 23 | android:layout_width="wrap_content" |
| 22 | android:layout_height="wrap_content" | 24 | android:layout_height="wrap_content" |
| 23 | android:layout_margin="16dp" | 25 | android:layout_margin="12dp" |
| 24 | android:text="@string/next" | 26 | android:text="@string/next" |
| 25 | android:visibility="invisible" | 27 | android:visibility="invisible" |
| 26 | app:layout_constraintBottom_toBottomOf="parent" | 28 | app:layout_constraintBottom_toBottomOf="parent" |
| @@ -31,7 +33,7 @@ | |||
| 31 | android:id="@+id/button_back" | 33 | android:id="@+id/button_back" |
| 32 | android:layout_width="wrap_content" | 34 | android:layout_width="wrap_content" |
| 33 | android:layout_height="wrap_content" | 35 | android:layout_height="wrap_content" |
| 34 | android:layout_margin="16dp" | 36 | android:layout_margin="12dp" |
| 35 | android:text="@string/back" | 37 | android:text="@string/back" |
| 36 | android:visibility="invisible" | 38 | android:visibility="invisible" |
| 37 | app:layout_constraintBottom_toBottomOf="parent" | 39 | app:layout_constraintBottom_toBottomOf="parent" |
diff --git a/src/android/app/src/main/res/layout/page_setup.xml b/src/android/app/src/main/res/layout/page_setup.xml index 965019cdb..1436ef308 100644 --- a/src/android/app/src/main/res/layout/page_setup.xml +++ b/src/android/app/src/main/res/layout/page_setup.xml | |||
| @@ -1,40 +1,56 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.appcompat.widget.LinearLayoutCompat | 2 | <androidx.constraintlayout.widget.ConstraintLayout |
| 3 | xmlns:android="http://schemas.android.com/apk/res/android" | 3 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 | xmlns:app="http://schemas.android.com/apk/res-auto" | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 5 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
| 6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
| 7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent"> |
| 8 | android:orientation="vertical" | ||
| 9 | android:paddingBottom="64dp"> | ||
| 10 | 8 | ||
| 11 | <ImageView | 9 | <ImageView |
| 12 | android:id="@+id/icon" | 10 | android:id="@+id/icon" |
| 13 | android:layout_width="220dp" | 11 | android:layout_width="0dp" |
| 14 | android:layout_height="220dp" | 12 | android:layout_height="0dp" |
| 15 | android:layout_marginTop="64dp" | 13 | android:layout_marginTop="64dp" |
| 16 | android:layout_gravity="center" /> | 14 | android:layout_marginBottom="32dp" |
| 15 | app:layout_constraintBottom_toTopOf="@+id/text_title" | ||
| 16 | app:layout_constraintEnd_toEndOf="parent" | ||
| 17 | app:layout_constraintHeight_max="220dp" | ||
| 18 | app:layout_constraintHeight_min="110dp" | ||
| 19 | app:layout_constraintStart_toStartOf="parent" | ||
| 20 | app:layout_constraintTop_toTopOf="parent" | ||
| 21 | app:layout_constraintVertical_chainStyle="spread" | ||
| 22 | app:layout_constraintWidth_max="220dp" | ||
| 23 | app:layout_constraintWidth_min="110dp" | ||
| 24 | app:layout_constraintVertical_weight="3" /> | ||
| 17 | 25 | ||
| 18 | <com.google.android.material.textview.MaterialTextView | 26 | <com.google.android.material.textview.MaterialTextView |
| 19 | style="@style/TextAppearance.Material3.DisplayMedium" | ||
| 20 | android:id="@+id/text_title" | 27 | android:id="@+id/text_title" |
| 21 | android:layout_width="match_parent" | 28 | style="@style/TextAppearance.Material3.DisplayMedium" |
| 22 | android:layout_height="wrap_content" | 29 | android:layout_width="0dp" |
| 23 | android:layout_marginTop="64dp" | 30 | android:layout_height="0dp" |
| 24 | android:textAlignment="center" | 31 | android:textAlignment="center" |
| 25 | android:textColor="?attr/colorOnSurface" | 32 | android:textColor="?attr/colorOnSurface" |
| 26 | android:textStyle="bold" | 33 | android:textStyle="bold" |
| 34 | app:layout_constraintBottom_toTopOf="@+id/text_description" | ||
| 35 | app:layout_constraintEnd_toEndOf="parent" | ||
| 36 | app:layout_constraintStart_toStartOf="parent" | ||
| 37 | app:layout_constraintTop_toBottomOf="@+id/icon" | ||
| 38 | app:layout_constraintVertical_weight="1.3" | ||
| 27 | tools:text="@string/welcome" /> | 39 | tools:text="@string/welcome" /> |
| 28 | 40 | ||
| 29 | <com.google.android.material.textview.MaterialTextView | 41 | <com.google.android.material.textview.MaterialTextView |
| 30 | style="@style/TextAppearance.Material3.TitleLarge" | ||
| 31 | android:id="@+id/text_description" | 42 | android:id="@+id/text_description" |
| 32 | android:layout_width="match_parent" | 43 | style="@style/TextAppearance.Material3.TitleLarge" |
| 33 | android:layout_height="wrap_content" | 44 | android:layout_width="0dp" |
| 34 | android:layout_marginTop="24dp" | 45 | android:layout_height="0dp" |
| 35 | android:paddingHorizontal="32dp" | ||
| 36 | android:textAlignment="center" | 46 | android:textAlignment="center" |
| 37 | android:textSize="26sp" | 47 | android:textSize="26sp" |
| 48 | android:paddingHorizontal="16dp" | ||
| 49 | app:layout_constraintBottom_toTopOf="@+id/button_action" | ||
| 50 | app:layout_constraintEnd_toEndOf="parent" | ||
| 51 | app:layout_constraintStart_toStartOf="parent" | ||
| 52 | app:layout_constraintTop_toBottomOf="@+id/text_title" | ||
| 53 | app:layout_constraintVertical_weight="2" | ||
| 38 | app:lineHeight="40sp" | 54 | app:lineHeight="40sp" |
| 39 | tools:text="@string/welcome_description" /> | 55 | tools:text="@string/welcome_description" /> |
| 40 | 56 | ||
| @@ -42,11 +58,15 @@ | |||
| 42 | android:id="@+id/button_action" | 58 | android:id="@+id/button_action" |
| 43 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
| 44 | android:layout_height="56dp" | 60 | android:layout_height="56dp" |
| 45 | android:layout_marginTop="96dp" | ||
| 46 | android:layout_gravity="center" | ||
| 47 | android:textSize="20sp" | 61 | android:textSize="20sp" |
| 48 | app:iconSize="24sp" | 62 | android:layout_marginTop="16dp" |
| 63 | android:layout_marginBottom="48dp" | ||
| 49 | app:iconGravity="end" | 64 | app:iconGravity="end" |
| 65 | app:iconSize="24sp" | ||
| 66 | app:layout_constraintBottom_toBottomOf="parent" | ||
| 67 | app:layout_constraintEnd_toEndOf="parent" | ||
| 68 | app:layout_constraintStart_toStartOf="parent" | ||
| 69 | app:layout_constraintTop_toBottomOf="@+id/text_description" | ||
| 50 | tools:text="Get started" /> | 70 | tools:text="Get started" /> |
| 51 | 71 | ||
| 52 | </androidx.appcompat.widget.LinearLayoutCompat> | 72 | </androidx.constraintlayout.widget.ConstraintLayout> |