From f41939b66e09d39c3a87ab53bf681738af59a893 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 26 Apr 2023 01:54:55 -0400 Subject: 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. --- .../app/src/main/res/layout/fragment_setup.xml | 8 +-- 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 @@ android:id="@+id/viewPager2" android:layout_width="0dp" android:layout_height="0dp" - app:layout_constraintBottom_toBottomOf="parent" + android:clipToPadding="false" + android:layout_marginBottom="16dp" + app:layout_constraintBottom_toTopOf="@+id/button_next" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -20,7 +22,7 @@ android:id="@+id/button_next" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="16dp" + android:layout_margin="12dp" android:text="@string/next" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" @@ -31,7 +33,7 @@ android:id="@+id/button_back" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="16dp" + android:layout_margin="12dp" android:text="@string/back" android:visibility="invisible" 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 @@ - + android:layout_height="match_parent"> + android:layout_marginBottom="32dp" + app:layout_constraintBottom_toTopOf="@+id/text_title" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHeight_max="220dp" + app:layout_constraintHeight_min="110dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="spread" + app:layout_constraintWidth_max="220dp" + app:layout_constraintWidth_min="110dp" + app:layout_constraintVertical_weight="3" /> @@ -42,11 +58,15 @@ android:id="@+id/button_action" android:layout_width="wrap_content" android:layout_height="56dp" - android:layout_marginTop="96dp" - android:layout_gravity="center" android:textSize="20sp" - app:iconSize="24sp" + android:layout_marginTop="16dp" + android:layout_marginBottom="48dp" app:iconGravity="end" + app:iconSize="24sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/text_description" tools:text="Get started" /> - + -- cgit v1.2.3