自定义告警弹窗

This commit is contained in:
2026-04-29 15:11:28 +08:00
parent 827d85724e
commit 5004917d66
25 changed files with 985 additions and 9 deletions

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FAEEE5" />
<corners android:radius="30dp" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#E9F4FF" />
<corners android:radius="30dp" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#E9EBFD" />
<corners android:radius="30dp" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<corners android:radius="30dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:radius="8dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/round_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingStart="24dp"
android:paddingTop="32dp"
android:paddingEnd="24dp"
android:paddingBottom="28dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/black"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:gravity="center"
android:lineSpacingExtra="2dp"
android:textColor="@color/gray"
android:textSize="14dp" />
<EditText
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="18dp"
android:background="@drawable/textinput_white_bg"
android:gravity="center_vertical"
android:hint="请输入"
android:inputType="numberDecimal"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="@color/black"
android:textColorHint="@color/gray"
android:textSize="16sp"
android:visibility="gone" />
</LinearLayout>
<View
android:id="@+id/v_divider_top"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dialog_view" />
<LinearLayout
android:id="@+id/layout_actions"
android:layout_width="match_parent"
android:layout_height="56dp"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_negative"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold" />
<View
android:id="@+id/v_divider_center"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/dialog_view" />
<TextView
android:id="@+id/btn_positive"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/green"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

View File

@@ -45,7 +45,7 @@
<ImageView
android:id="@+id/ivFamilyArrow"
android:layout_width="12dp"
android:layout_height="6dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:src="@drawable/triangle" />
</LinearLayout>
@@ -57,6 +57,7 @@
android:orientation="horizontal">
<FrameLayout
android:id="@+id/message"
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_marginEnd="10dp"

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/message_bg"
tools:context=".home.MessageActivity">
<ImageView
android:id="@+id/ivBack"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:contentDescription="@null"
android:src="@mipmap/back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="消息列表"
android:textColor="#333333"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMessageList"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTitle"
tools:listitem="@layout/item_message_notice" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,12 +3,224 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".home.PersonalFragment">
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/headerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="个人 Fragment"
android:textSize="20sp"/>
android:background="@drawable/bg_personal_header_gradient"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp"
android:paddingTop="16dp"
android:paddingBottom="18dp">
<ImageView
android:id="@+id/ivAvatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:padding="2dp"
android:src="@mipmap/ic_launcher_round" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="这里是昵称"
android:textColor="@color/black"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvRoleTag"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginStart="8dp"
android:background="@drawable/rounded_blue_bg"
android:gravity="center"
android:paddingHorizontal="8dp"
android:text="管理员"
android:textColor="@color/white"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="13589898989"
android:textColor="#666666"
android:textSize="16dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/itemSwitchFamily"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/bg_detail_border"
android:padding="8dp"
android:src="@drawable/switch_family" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="切换家庭"
android:textColor="@color/black"
android:textSize="16dp" />
<TextView
android:id="@+id/tvCurrentFamily"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:text="我的家庭"
android:textColor="@color/green"
android:textSize="14dp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginStart="8dp"
android:src="@drawable/right_back" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemUserManage"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/bg_user_manage"
android:padding="8dp"
android:src="@drawable/user_manage" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="用户管理"
android:textColor="@color/black"
android:textSize="16dp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/right_back" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemPwdManage"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/bg_pwd_manager"
android:padding="8dp"
android:src="@drawable/pwd_manager" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="密码管理"
android:textColor="@color/black"
android:textSize="16dp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/right_back" />
</LinearLayout>
<LinearLayout
android:id="@+id/itemFaceManage"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/bg_face_manage"
android:padding="8dp"
android:src="@drawable/face_manage" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="人脸管理"
android:textColor="@color/black"
android:textSize="16dp" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/right_back" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/btnLogout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginHorizontal="24dp"
android:layout_marginBottom="28dp"
android:background="@drawable/bg_logout_button"
android:gravity="center"
android:text="退出登录"
android:textColor="#9B9B9B"
android:textSize="14dp" />
</LinearLayout>

View File

@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/message_bg"
android:orientation="vertical"
tools:context=".personal.PersonalProfileActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/topBar"
android:layout_width="match_parent"
android:layout_height="56dp">
<ImageView
android:id="@+id/ivBack"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:src="@mipmap/back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="个人资料"
android:textColor="@color/black"
android:textSize="16dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:gravity="center">
<ImageView
android:id="@+id/ivAvatar"
android:layout_width="112dp"
android:layout_height="112dp"
android:padding="2dp"
android:src="@mipmap/ic_launcher_round" />
<RelativeLayout
android:gravity="center"
android:layout_width="33dp"
android:layout_height="33dp"
android:layout_alignBottom="@id/ivAvatar"
android:layout_alignEnd="@id/ivAvatar"
android:layout_marginBottom="5dp"
android:background="@drawable/bg_white"
android:layout_marginEnd="12dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:padding="8dp"
android:src="@drawable/phone"/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp">
<LinearLayout
android:id="@+id/itemNickname"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="昵称"
android:textColor="@color/black"
android:textSize="16dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end|center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvNickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:text="这里是昵称"
android:textColor="@color/gray"
android:textSize="14dp" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:src="@drawable/right_back" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/itemPhone"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="绑定手机"
android:textColor="@color/black"
android:textSize="16dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end|center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:text="13589898989"
android:textColor="@color/gray"
android:textSize="14dp" />
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:src="@drawable/right_back" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -11,5 +11,7 @@
<color name="ic_selected">#000000 </color>
<color name="ic_normal">#999999 </color>
<color name="ic_gray">#99000000 </color>
<color name="dialog_view">#E7E7E7 </color>
<color name="message_bg">#F9F9F9 </color>
</resources>