init global config view and app list view

This commit is contained in:
jiqiu2021
2025-06-25 17:41:00 +08:00
parent 4fe44ae346
commit 499a26feec
15 changed files with 830 additions and 9 deletions

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<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:layout_height="wrap_content"
android:layout_margin="4dp"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="12dp"
android:gravity="center_vertical">
<!-- 应用图标 -->
<ImageView
android:id="@+id/app_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="12dp"
android:scaleType="centerCrop" />
<!-- 应用信息 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end" />
<TextView
android:id="@+id/package_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@android:color/darker_gray"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginTop="2dp" />
<!-- 系统应用标签 -->
<TextView
android:id="@+id/system_app_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/system_app"
android:textSize="10sp"
android:textColor="@android:color/white"
android:background="@drawable/system_app_badge"
android:padding="4dp"
android:layout_marginTop="4dp"
android:visibility="gone" />
</LinearLayout>
<!-- 启用开关 -->
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/switch_enable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>