refactor(dialog): 重构 CommonDialog 为链式调用 API,内置 title/content,全量替换旧调用方

This commit is contained in:
2026-04-16 15:02:33 +08:00
parent c3f3b1215b
commit ad63639f66
12 changed files with 196 additions and 208 deletions
+26 -10
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
@@ -8,10 +7,29 @@
android:background="@drawable/shape_white_30_corners"
android:orientation="vertical">
<FrameLayout
android:id="@+id/llContent"
<TextView
android:id="@+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="55dp"
android:layout_marginEnd="40dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="36sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="55dp"
android:gravity="center"
android:textColor="@color/black999"
android:textSize="26sp" />
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
@@ -20,7 +38,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_height="100dp"
android:gravity="center_vertical"
android:orientation="horizontal">
@@ -32,8 +50,7 @@
android:gravity="center"
android:background="@drawable/ripple_effect_light2"
android:textColor="@color/dish_green"
android:textSize="30sp"
tools:text="取消" />
android:textSize="30sp" />
<com.google.android.material.divider.MaterialDivider
android:layout_width="1dp"
@@ -49,8 +66,7 @@
android:textColor="@color/dish_green"
android:background="@drawable/ripple_effect_light2"
android:textSize="30sp"
android:textStyle="bold"
tools:text="确定" />
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>