feat: 提示弹窗按原型图V3重设计
- 圆形图标背景(85dp):成功绿/错误红/警告橙 15%透明 - 标题 28sp(原22sp) - 描述 20sp(原15sp) - 倒计时 18sp - 整体居中,大字醒目 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,23 +66,28 @@ class QuTipDialog(
|
||||
// 加载 iconfont 字体
|
||||
val typeface = Typeface.createFromAsset(container.context.assets, "font/iconfont.ttf")
|
||||
|
||||
// 设置状态图标和颜色
|
||||
// 设置圆形背景和图标
|
||||
val iconBg = view.findViewById<View>(R.id.tipIconBg)
|
||||
val iconView = view.findViewById<TextView>(R.id.tipIcon)
|
||||
iconView.typeface = typeface
|
||||
when (status) {
|
||||
Status.SUCCESS -> {
|
||||
iconBg.setBackgroundResource(R.drawable.bg_feedback_success)
|
||||
iconView.text = IconFont.SUCCESS
|
||||
iconView.setTextColor(container.context.getColor(R.color.success))
|
||||
}
|
||||
Status.WARNING -> {
|
||||
iconBg.setBackgroundResource(R.drawable.bg_feedback_warning)
|
||||
iconView.text = IconFont.WARNING
|
||||
iconView.setTextColor(container.context.getColor(R.color.warning))
|
||||
}
|
||||
Status.ERROR -> {
|
||||
iconBg.setBackgroundResource(R.drawable.bg_feedback_error)
|
||||
iconView.text = IconFont.ERROR
|
||||
iconView.setTextColor(container.context.getColor(R.color.error))
|
||||
}
|
||||
Status.LOCATION -> {
|
||||
iconBg.setBackgroundResource(R.drawable.bg_feedback_success)
|
||||
iconView.text = IconFont.LOCATION
|
||||
iconView.setTextColor(container.context.getColor(R.color.success))
|
||||
}
|
||||
|
||||
5
app/src/main/res/drawable/bg_feedback_error.xml
Normal file
5
app/src/main/res/drawable/bg_feedback_error.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 错误反馈圆形背景(红色15%透明) -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="#26FF6B6B" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/bg_feedback_success.xml
Normal file
5
app/src/main/res/drawable/bg_feedback_success.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 成功反馈圆形背景(绿色15%透明) -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="#264ADE80" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/bg_feedback_warning.xml
Normal file
5
app/src/main/res/drawable/bg_feedback_warning.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 警告反馈圆形背景(橙色15%透明) -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="#26FFB340" />
|
||||
</shape>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- QuTipDialog 布局:提示弹窗(成功/警告/错误)
|
||||
结构:全屏遮罩 + 居中内容(图标 + 标题 + 描述 + 倒计时返回按钮) -->
|
||||
<!-- QuTipDialog:反馈提示弹窗(按原型图V3样式)
|
||||
圆形图标背景 + 大标题 + 描述 + 倒计时 -->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -11,45 +11,60 @@
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/spacing_lg">
|
||||
android:paddingStart="21dp"
|
||||
android:paddingEnd="21dp">
|
||||
|
||||
<!-- 状态图标(成功✓ / 警告! / 错误×) -->
|
||||
<TextView
|
||||
android:id="@+id/tipIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="56sp"
|
||||
android:layout_marginBottom="@dimen/spacing_md" />
|
||||
<!-- 圆形图标背景(85dp) -->
|
||||
<FrameLayout
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="85dp"
|
||||
android:layout_marginBottom="19dp">
|
||||
|
||||
<!-- 标题文字 -->
|
||||
<View
|
||||
android:id="@+id/tipIconBg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tipIcon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="38sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!-- 标题(28sp) -->
|
||||
<TextView
|
||||
android:id="@+id/tipTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="@dimen/text_title"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="@dimen/spacing_sm" />
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 描述文字(可选) -->
|
||||
<!-- 描述(20sp) -->
|
||||
<TextView
|
||||
android:id="@+id/tipDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/text_caption"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="@dimen/spacing_lg" />
|
||||
android:lineSpacingMultiplier="1.4"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 倒计时返回按钮(显示"返回 3s") -->
|
||||
<!-- 倒计时 -->
|
||||
<TextView
|
||||
android:id="@+id/tipBackBtn"
|
||||
android:layout_width="@dimen/touch_min_size"
|
||||
android:layout_height="@dimen/touch_min_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="@dimen/text_caption"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:padding="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user