From 63608b5dca9eebb6fa2cb1a8652b395f1d910c3e Mon Sep 17 00:00:00 2001
From: 张钢 <floatgang@163.com>
Date: 星期一, 02 九月 2024 13:52:17 +0800
Subject: [PATCH] 对新接口进行了适配
---
app/src/main/res/layout/item_home_devices.xml | 222 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 165 insertions(+), 57 deletions(-)
diff --git a/app/src/main/res/layout/item_home_devices.xml b/app/src/main/res/layout/item_home_devices.xml
index 1901386..37b0773 100644
--- a/app/src/main/res/layout/item_home_devices.xml
+++ b/app/src/main/res/layout/item_home_devices.xml
@@ -19,57 +19,121 @@
android:layout_height="40dp"
android:layout_margin="@dimen/dp_2"
app:cardCornerRadius="@dimen/dp_10"
- app:cardBackgroundColor="@color/color_card_pink"
+ app:cardBackgroundColor="?attr/cardBackgroundColorFirst"
+ tools:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
- <LinearLayout
+
+ <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_title"
android:layout_width="match_parent"
- android:layout_height="@dimen/dp_40"
- android:gravity="center_vertical"
- >
- <TextView
+ android:layout_height="40dp"
+ android:gravity="center_vertical">
+ <CheckBox
+ android:id="@+id/checkbox"
+ android:layout_width="18dp"
+ android:layout_height="18dp"
+ android:layout_marginStart="3dp"
+ android:layout_centerVertical="true"
+ android:button="?attr/checkboxSelector"
+ android:background="?selectableItemBackgroundBorderless"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ />
+ <ImageView
+ android:id="@+id/iv_flower"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginStart="3dp"
android:layout_centerVertical="true"
- android:layout_marginStart="24dp"
- android:textSize="@dimen/sp_16"
- android:textColor="@color/black"
- android:text="@{bean.name}"
- android:textStyle="bold"
- tools:text="鐢佃"
+ android:background="?attr/icIsOwnFamilyDataFlower"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
/>
-
- <TextView
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/textView1"
android:layout_width="0dp"
- android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="24dp"
+ android:text="@{bean.name}"
+ android:textColor="@color/black"
+ android:textSize="16sp"
+ android:gravity="start|center_vertical"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/textView2"
+ app:layout_constraintHorizontal_weight="1.5"
+ android:ellipsize="end"
+ android:maxLines="1"
+ app:autoSizeTextType="uniform"
+ app:autoSizeMaxTextSize="16sp"
+ app:autoSizeMinTextSize="12sp"
+ app:layout_constraintHorizontal_chainStyle="spread_inside"
+ tools:text="鐢佃" />
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/textView2"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
- android:layout_marginStart="24dp"
- android:text="@{bean.address}"
- android:textColor="@color/black"
- android:textSize="@dimen/sp_16"
- android:textStyle="bold"
android:gravity="center"
- tools:text="寮犱笁" />
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="@dimen/sp_16"
+ android:text="@{bean.location}"
android:textColor="@color/black"
- android:text="@{bean.createTime}"
- android:textStyle="bold"
- android:layout_marginEnd="24dp"
- android:layout_alignParentEnd="true"
- android:layout_centerVertical="true"
+ android:textSize="16sp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/tv_time"
+ app:layout_constraintStart_toEndOf="@+id/textView1"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintHorizontal_weight="2"
+ android:layout_marginHorizontal="20dp"
+ android:ellipsize="end"
+ android:maxLines="1"
+ app:autoSizeTextType="uniform"
+ app:autoSizeMaxTextSize="16sp"
+ app:autoSizeMinTextSize="12sp"
+ tools:text="瀹㈠巺" />
+
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/tv_time"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@{bean.happenTime}"
+ android:textColor="@color/black"
+ android:textSize="16sp"
+ android:layout_marginEnd="10dp"
+ android:gravity="center_vertical|center"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@id/iv_fold"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toEndOf="@id/textView2"
+ app:layout_constraintHorizontal_weight="2"
+ android:maxLines="1"
+ android:ellipsize="end"
+ app:autoSizeTextType="uniform"
+ app:autoSizeMaxTextSize="16sp"
+ app:autoSizeMinTextSize="12sp"
tools:text="2019-01-12"
/>
+ <ImageView
+ android:id="@+id/iv_fold"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_fold"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ android:layout_marginEnd="10dp"
+ />
- </LinearLayout>
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
<LinearLayout
android:id="@+id/layout_content"
android:layout_width="match_parent"
@@ -81,118 +145,162 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="@dimen/dp_6"
+ android:layout_marginBottom="6dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="搴忓彿锛�"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{String.valueOf(bean.id)}"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="@dimen/dp_6"
+ android:layout_marginBottom="6dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="璐拱浜猴細"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@{bean.people}"
+ android:text="@{bean.buyer}"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="@dimen/dp_6"
+ android:layout_marginBottom="6dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浜嬮」鍐呭锛�"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.content}"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="@dimen/dp_6"
+ android:layout_marginBottom="6dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="澶囨敞锛�"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{bean.remark}"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/dp_6"
+ android:layout_marginBottom="6dp"
android:text="鐢靛瓙鏂囦欢锛�"
android:textColor="@color/black"
- android:textSize="@dimen/sp_12"
- android:textStyle="bold"
+ android:textSize="12sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:layout_marginBottom="@dimen/dp_15"
+ android:layout_marginBottom="15dp"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- tools:listitem="@layout/item_image"
+ tools:listitem="@layout/item_electronic_file"
tools:itemCount="3"
/>
</LinearLayout>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginBottom="@dimen/dp_12"
+ android:visibility="gone"
+ tools:visibility="visible"
+ >
+ <LinearLayout
+ android:id="@+id/layout_modify"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ >
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_modify"
+ android:layout_gravity="center"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="淇敼"
+ android:textColor="@color/black"
+ android:textSize="@dimen/sp_14"
+
+ android:layout_marginStart="@dimen/dp_4"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/layout_delete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_marginStart="@dimen/dp_52"
+ >
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/ic_delete"
+ android:layout_gravity="center"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="鍒犻櫎"
+ android:textColor="#FFE86F72"
+ android:textSize="@dimen/sp_14"
+
+ android:layout_marginStart="@dimen/dp_4"
+ />
+ </LinearLayout>
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
--
Gitblit v1.9.1