VmTerminalApp: Optimize settings_list_item
MaterialCardView is a FrameLayout, so we don't need to nest it.
Bug: N/A
Test: Manually
Change-Id: Iba08e18298759d6a287c33e6a3cae2deb13c8a55
diff --git a/android/TerminalApp/res/layout/settings_list_item.xml b/android/TerminalApp/res/layout/settings_list_item.xml
index 167e57b..b48c5d3 100644
--- a/android/TerminalApp/res/layout/settings_list_item.xml
+++ b/android/TerminalApp/res/layout/settings_list_item.xml
@@ -14,61 +14,56 @@
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.google.android.material.card.MaterialCardView
+ xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:gravity="center_vertical"
- android:layout_height="wrap_content">
+ android:id="@+id/settings_list_item_card"
+ app:strokeWidth="0dp"
+ app:cardCornerRadius="28dp"
+ app:checkedIcon="@null"
+ android:focusable="true"
+ android:checkable="true"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent">
- <com.google.android.material.card.MaterialCardView
- android:id="@+id/settings_list_item_card"
- app:strokeWidth="0dp"
- app:cardCornerRadius="28dp"
- app:checkedIcon="@null"
- android:focusable="true"
- android:checkable="true"
- android:layout_height="wrap_content"
- android:layout_width="match_parent">
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="88dp"
+ android:layout_marginStart="24dp"
+ android:layout_marginEnd="16dp">
- <androidx.constraintlayout.widget.ConstraintLayout
- android:layout_width="match_parent"
- android:layout_height="88dp"
+ <com.google.android.material.imageview.ShapeableImageView
+ android:id="@+id/settings_list_item_icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_marginEnd="24dp"
+ android:scaleType="centerCrop"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent" />
+
+ <TextView
+ android:id="@+id/settings_list_item_title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="20dp"
android:layout_marginStart="24dp"
- android:layout_marginEnd="16dp">
+ android:textSize="20sp"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toTopOf="@+id/settings_list_item_sub_title"
+ app:layout_constraintStart_toEndOf="@id/settings_list_item_icon"
+ app:layout_constraintEnd_toEndOf="parent" />
- <com.google.android.material.imageview.ShapeableImageView
- android:id="@+id/settings_list_item_icon"
- android:layout_width="24dp"
- android:layout_height="24dp"
- android:layout_marginEnd="24dp"
- android:scaleType="centerCrop"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent" />
-
- <TextView
- android:id="@+id/settings_list_item_title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dp"
- android:layout_marginStart="24dp"
- android:textSize="20sp"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toTopOf="@+id/settings_list_item_sub_title"
- app:layout_constraintStart_toEndOf="@id/settings_list_item_icon"
- app:layout_constraintEnd_toEndOf="parent" />
-
- <TextView
- android:id="@+id/settings_list_item_sub_title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:textSize="14sp"
- android:layout_marginBottom="20dp"
- android:layout_marginStart="24dp"
- app:layout_constraintTop_toBottomOf="@+id/settings_list_item_title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/settings_list_item_icon"
- app:layout_constraintEnd_toEndOf="parent" />
- </androidx.constraintlayout.widget.ConstraintLayout>
- </com.google.android.material.card.MaterialCardView>
-</FrameLayout>
\ No newline at end of file
+ <TextView
+ android:id="@+id/settings_list_item_sub_title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:textSize="14sp"
+ android:layout_marginBottom="20dp"
+ android:layout_marginStart="24dp"
+ app:layout_constraintTop_toBottomOf="@+id/settings_list_item_title"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toEndOf="@id/settings_list_item_icon"
+ app:layout_constraintEnd_toEndOf="parent" />
+ </androidx.constraintlayout.widget.ConstraintLayout>
+</com.google.android.material.card.MaterialCardView>
\ No newline at end of file