From 782f079436cf8035d1d9ce477b1d6a50bbd07352 Mon Sep 17 00:00:00 2001 From: kaisar945 Date: Fri, 1 Mar 2024 15:49:29 +0800 Subject: [PATCH 1/2] Improve layout-add a scroll view to avoid covering the buttons on low-resolution devices --- app/src/main/res/layout-h680dp/main_layout.xml | 18 +++++++++++++----- app/src/main/res/layout/main_layout.xml | 17 ++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/layout-h680dp/main_layout.xml b/app/src/main/res/layout-h680dp/main_layout.xml index 6cd964a..dead5c6 100644 --- a/app/src/main/res/layout-h680dp/main_layout.xml +++ b/app/src/main/res/layout-h680dp/main_layout.xml @@ -44,19 +44,27 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - + app:layout_constraintBottom_toTopOf="@+id/materialCardView"> + + + + - + app:layout_constraintBottom_toTopOf="@+id/materialCardView"> + + + + Date: Tue, 9 Apr 2024 15:10:03 +0800 Subject: [PATCH 2/2] Reduce main layout guideline percent on low-resolution devices --- app/src/main/res/layout-h380dp-land/main_layout.xml | 2 +- app/src/main/res/layout-h680dp/main_layout.xml | 2 +- app/src/main/res/layout/main_layout.xml | 2 +- app/src/main/res/values-h380dp-land/dimens.xml | 4 ++++ app/src/main/res/values-h380dp/dimens.xml | 4 ++++ app/src/main/res/values-h680dp/dimens.xml | 4 ++++ app/src/main/res/values/dimens.xml | 4 ++++ 7 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/values-h380dp-land/dimens.xml create mode 100644 app/src/main/res/values-h380dp/dimens.xml create mode 100644 app/src/main/res/values-h680dp/dimens.xml create mode 100644 app/src/main/res/values/dimens.xml diff --git a/app/src/main/res/layout-h380dp-land/main_layout.xml b/app/src/main/res/layout-h380dp-land/main_layout.xml index 01741f2..2411bf1 100644 --- a/app/src/main/res/layout-h380dp-land/main_layout.xml +++ b/app/src/main/res/layout-h380dp-land/main_layout.xml @@ -17,7 +17,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" - app:layout_constraintGuide_percent="0.06" /> + app:layout_constraintGuide_percent="@integer/guide_line_percent" /> + app:layout_constraintGuide_percent="@integer/guide_line_percent" /> + app:layout_constraintGuide_percent="@integer/guide_line_percent" /> + + 0.06 + \ No newline at end of file diff --git a/app/src/main/res/values-h380dp/dimens.xml b/app/src/main/res/values-h380dp/dimens.xml new file mode 100644 index 0000000..dcaa4b4 --- /dev/null +++ b/app/src/main/res/values-h380dp/dimens.xml @@ -0,0 +1,4 @@ + + + 0.08 + \ No newline at end of file diff --git a/app/src/main/res/values-h680dp/dimens.xml b/app/src/main/res/values-h680dp/dimens.xml new file mode 100644 index 0000000..3004b09 --- /dev/null +++ b/app/src/main/res/values-h680dp/dimens.xml @@ -0,0 +1,4 @@ + + + 0.16 + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..c98351c --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,4 @@ + + + 0.18 + \ No newline at end of file