Skip to content

Commit 67dfa50

Browse files
Merge pull request #243 from MihaiCristianCondrea/codex/optimize-android-xml-layouts-for-performance-6ud8i3
Optimize layout containers for scroll performance
2 parents 0221b4f + d1fc047 commit 67dfa50

10 files changed

+17
-21
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<androidx.appcompat.widget.LinearLayoutCompat
1616
android:layout_width="match_parent"
17-
android:layout_height="match_parent"
17+
android:layout_height="wrap_content"
1818
android:orientation="vertical">
1919

2020
<com.google.android.material.textview.MaterialTextView

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<androidx.appcompat.widget.LinearLayoutCompat
1616
android:layout_width="match_parent"
17-
android:layout_height="match_parent"
17+
android:layout_height="wrap_content"
1818
android:orientation="vertical">
1919

2020
<com.google.android.material.textview.MaterialTextView

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<androidx.appcompat.widget.LinearLayoutCompat
1616
android:layout_width="match_parent"
17-
android:layout_height="match_parent"
17+
android:layout_height="wrap_content"
1818
android:orientation="vertical">
1919

2020
<com.google.android.material.textview.MaterialTextView
@@ -96,8 +96,7 @@
9696
android:layout_height="wrap_content"
9797
android:layout_gravity="center"
9898
android:layout_margin="24dp"
99-
android:orientation="horizontal"
100-
app:layout_constraintStart_toStartOf="parent">
99+
android:orientation="horizontal">
101100

102101
<com.google.android.material.button.MaterialButton
103102
style="@style/Widget.Material3.Button.ElevatedButton"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:id="@+id/container"
44
android:layout_width="match_parent"
5-
android:layout_height="match_parent"
6-
android:orientation="vertical">
5+
android:layout_height="match_parent">
76

87
<FrameLayout
98
android:id="@+id/frame_layout_permissions"
109
android:layout_width="match_parent"
1110
android:layout_height="match_parent" />
12-
</androidx.constraintlayout.widget.ConstraintLayout>
11+
</FrameLayout>
12+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<androidx.constraintlayout.widget.ConstraintLayout
1010
android:layout_width="match_parent"
11-
android:layout_height="match_parent">
11+
android:layout_height="wrap_content">
1212

1313
<com.google.android.material.textview.MaterialTextView
1414
android:id="@+id/text_view_permissions_beginning"

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<androidx.appcompat.widget.LinearLayoutCompat
1616
android:layout_width="match_parent"
17-
android:layout_height="match_parent"
17+
android:layout_height="wrap_content"
1818
android:orientation="vertical">
1919

2020
<com.google.android.material.textview.MaterialTextView
@@ -83,10 +83,7 @@
8383
android:layout_height="wrap_content"
8484
android:layout_gravity="center"
8585
android:layout_margin="24dp"
86-
android:indeterminate="true"
87-
app:layout_constraintEnd_toEndOf="parent"
88-
app:layout_constraintStart_toStartOf="parent"
89-
app:layout_constraintTop_toTopOf="parent" />
86+
android:indeterminate="true" />
9087

9188
<com.google.android.material.button.MaterialButton
9289
android:id="@+id/button_download"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<androidx.constraintlayout.widget.ConstraintLayout
1515
android:layout_width="match_parent"
16-
android:layout_height="match_parent">
16+
android:layout_height="wrap_content">
1717

1818
<com.google.android.material.textview.MaterialTextView
1919
android:id="@+id/text_view_welcome"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<androidx.appcompat.widget.LinearLayoutCompat
1818
android:layout_width="match_parent"
19-
android:layout_height="match_parent"
19+
android:layout_height="wrap_content"
2020
android:orientation="vertical">
2121

2222
<com.google.android.material.textview.MaterialTextView
@@ -66,7 +66,7 @@
6666
<com.google.android.material.materialswitch.MaterialSwitch
6767
android:id="@+id/material_switch_preference"
6868
android:layout_width="match_parent"
69-
android:layout_height="match_parent"
69+
android:layout_height="wrap_content"
7070
android:padding="24dp"
7171
android:text="@string/switch_me"
7272
android:tooltipText="@string/switch_me"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<androidx.appcompat.widget.LinearLayoutCompat
3333
android:layout_width="match_parent"
34-
android:layout_height="match_parent"
34+
android:layout_height="wrap_content"
3535
android:gravity="center_vertical"
3636
android:orientation="horizontal"
3737
android:padding="16dp">
@@ -95,7 +95,7 @@
9595

9696
<androidx.appcompat.widget.LinearLayoutCompat
9797
android:layout_width="match_parent"
98-
android:layout_height="match_parent"
98+
android:layout_height="wrap_content"
9999
android:gravity="center_vertical"
100100
android:orientation="horizontal"
101101
android:padding="16dp">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<androidx.appcompat.widget.LinearLayoutCompat
1414
android:layout_width="match_parent"
15-
android:layout_height="match_parent"
15+
android:layout_height="wrap_content"
1616
android:layout_gravity="center_horizontal"
1717
android:gravity="center"
1818
android:orientation="vertical">

0 commit comments

Comments
 (0)