Skip to content

Commit 782f079

Browse files
committed
Improve layout-add a scroll view to avoid covering the buttons on low-resolution devices
1 parent 11c9388 commit 782f079

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

app/src/main/res/layout-h680dp/main_layout.xml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,27 @@
4444
app:layout_constraintEnd_toEndOf="parent"
4545
app:layout_constraintStart_toStartOf="parent" />
4646

47-
<LinearLayout
48-
android:id="@+id/statusDetailContainer"
49-
android:layout_width="wrap_content"
50-
android:layout_height="wrap_content"
47+
<ScrollView
48+
android:layout_width="match_parent"
49+
android:layout_height="0dp"
5150
android:layout_marginStart="16dp"
5251
android:layout_marginEnd="16dp"
5352
app:layout_constrainedWidth="true"
5453
app:layout_constraintEnd_toEndOf="parent"
5554
app:layout_constraintStart_toStartOf="parent"
5655
app:layout_constraintTop_toBottomOf="@+id/statusText"
57-
android:orientation="vertical" />
56+
app:layout_constraintBottom_toTopOf="@+id/materialCardView">
57+
58+
<LinearLayout
59+
android:id="@+id/statusDetailContainer"
60+
android:layout_width="match_parent"
61+
android:layout_height="wrap_content"
62+
android:orientation="vertical" />
63+
64+
</ScrollView>
5865

5966
<com.google.android.material.card.MaterialCardView
67+
android:id="@+id/materialCardView"
6068
android:layout_height="wrap_content"
6169
android:layout_width="match_parent"
6270
android:layout_marginStart="16dp"

app/src/main/res/layout/main_layout.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,25 @@
3636
app:layout_constraintEnd_toEndOf="parent"
3737
app:layout_constraintStart_toStartOf="parent"/>
3838

39-
<LinearLayout
40-
android:id="@+id/statusDetailContainer"
41-
android:layout_width="wrap_content"
42-
android:layout_height="wrap_content"
39+
<ScrollView
40+
android:layout_width="match_parent"
41+
android:layout_height="0dp"
4342
android:layout_marginTop="16dp"
4443
android:layout_marginStart="16dp"
4544
android:layout_marginEnd="16dp"
4645
app:layout_constrainedWidth="true"
4746
app:layout_constraintEnd_toEndOf="parent"
4847
app:layout_constraintStart_toStartOf="parent"
4948
app:layout_constraintTop_toBottomOf="@+id/statusText"
50-
android:orientation="vertical" />
49+
app:layout_constraintBottom_toTopOf="@+id/materialCardView">
50+
51+
<LinearLayout
52+
android:id="@+id/statusDetailContainer"
53+
android:layout_width="match_parent"
54+
android:layout_height="wrap_content"
55+
android:orientation="vertical" />
56+
57+
</ScrollView>
5158

5259
<com.google.android.material.card.MaterialCardView
5360
android:id="@+id/materialCardView"

0 commit comments

Comments
 (0)