切换家庭联动

This commit is contained in:
2026-05-16 17:18:05 +08:00
parent a8f202a906
commit 4c53c43f7b
23 changed files with 515 additions and 121 deletions

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFF"
android:pathData="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -78,11 +78,18 @@
android:layout_height="match_parent"
android:src="@drawable/message"/>
<View
android:layout_width="10dp"
android:layout_height="10dp"
<TextView
android:id="@+id/tvUnreadCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:background="@drawable/ic_red_dot" />
android:background="@drawable/bg_unread_dot"
android:minWidth="16dp"
android:height="16dp"
android:gravity="center"
android:textSize="10sp"
android:textColor="@color/white"
android:visibility="gone" />
</FrameLayout>
<FrameLayout

View File

@@ -2,7 +2,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:background="@drawable/bg_white"
android:layout_marginBottom="14dp"
@@ -29,22 +28,28 @@
android:src="@drawable/go_up" />
</LinearLayout>
<TextView
android:text="防雨机"
android:id="@+id/tvDeviceType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="10dp"
android:textColor="@color/black"
android:textSize="12dp" />
android:textSize="14dp"
android:textStyle="bold"/>
<TextView
android:text="离线"
android:id="@+id/tvDeviceName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="10dp"
android:textColor="@color/black"
android:textSize="12dp" />
android:textSize="12dp"
android:textStyle="bold"/>
</LinearLayout>

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout 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:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/message_bg"
android:orientation="vertical"
tools:context=".home.MessageActivity">
<LinearLayout
@@ -35,15 +35,35 @@
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMessageList"
<LinearLayout
android:id="@+id/contentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
tools:listitem="@layout/item_message_notice" />
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMessageList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingTop="12dp"
android:paddingBottom="16dp"
tools:listitem="@layout/item_message_notice" />
</LinearLayout>
<LinearLayout
android:id="@+id/emptyLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/no_message" />
</LinearLayout>
</RelativeLayout>

View File

@@ -15,9 +15,7 @@
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:paddingStart="16dp"
android:paddingEnd="16dp">
app:layout_constraintEnd_toEndOf="parent">
<ImageView
android:id="@+id/backIcon"
android:layout_width="24dp"

View File

@@ -109,6 +109,8 @@
<string name="join_family">加入家庭</string>
<string name="family_code">家庭码</string>
<string name="enter_family_code">请输入家庭码</string>
<string name="family_with_normal">的家庭</string>
<string name="no_device">暂无设备</string>
<!-- User Management -->
<string name="user_management">用户管理</string>

View File

@@ -56,6 +56,7 @@
<string name="profile">Profile</string>
<string name="admin_user">Administrator</string>
<string name="normal_user">Ordinary User</string>
<string name="family_with_normal">s Family</string>
<!-- Home Menu -->