From 54cb06b771447df9bca5f3eae88a9caaf8ec51ff Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 22 七月 2024 17:24:10 +0800
Subject: [PATCH] 2024年07月22日17:24:08
---
app/src/main/res/layout/swipe_right_layout.xml | 46 +++++++++++++++--------
app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java | 18 ++++++---
2 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
index 5b03584..e98ed2f 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/adapter/HouseInfoAdapter.java
@@ -6,6 +6,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -85,7 +86,7 @@
}
});
//绉诲姩鐢电珯浣嶇疆
- holder.move_home_iv.setOnClickListener(new View.OnClickListener() {
+ holder.move_home_ll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
@@ -96,8 +97,13 @@
}
}
});
+ holder.del_home_ll.setVisibility(View.GONE);
+ if (houseIdBean.getDeliverStatus().equals("UNDELIVERED")) {
+ //鏈氦浠樺畬瑕佹樉绀哄垹闄ゆ寜閽�
+ holder.del_home_ll.setVisibility(View.VISIBLE);
+ }
//鍒犻櫎鐢电珯
- holder.del_home_iv.setOnClickListener(new View.OnClickListener() {
+ holder.del_home_ll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
@@ -214,8 +220,8 @@
public TextView month_value_tv;//褰撴湀鍙戠數閲�
public TextView stateTv;//鐢电珯鐘舵��(杩炴帴涓�,杩愯,绂荤嚎,鏁呴殰);
public RelativeLayout item_parent_rl;//鏉$洰鐖跺鍣�
- public ImageView move_home_iv;//绉诲姩鐢电珯浣嶇疆
- public ImageView del_home_iv;//鍒犻櫎鐢电珯
+ public LinearLayout move_home_ll;//绉诲姩鐢电珯浣嶇疆
+ public LinearLayout del_home_ll;//鍒犻櫎鐢电珯
public TextView plant_details_location_tv;//鐢电珯鍦板潃
public SwipeLayout item_parent_swipeLayout;//鐖跺鍣�
@@ -229,8 +235,8 @@
month_value_tv = itemView.findViewById(R.id.month_value_tv);
stateTv = itemView.findViewById(R.id.fragment_house_list_line_state_tv);
item_parent_rl = itemView.findViewById(R.id.item_parent_rl);
- move_home_iv = itemView.findViewById(R.id.move_home_iv);
- del_home_iv = itemView.findViewById(R.id.del_home_iv);
+ move_home_ll = itemView.findViewById(R.id.move_ll);
+ del_home_ll = itemView.findViewById(R.id.del_ll);
plant_details_location_tv = itemView.findViewById(R.id.plant_details_location_tv);
item_parent_swipeLayout = itemView.findViewById(R.id.item_parent_swipeLayout);
}
diff --git a/app/src/main/res/layout/swipe_right_layout.xml b/app/src/main/res/layout/swipe_right_layout.xml
index 2b3e64e..bafaa12 100644
--- a/app/src/main/res/layout/swipe_right_layout.xml
+++ b/app/src/main/res/layout/swipe_right_layout.xml
@@ -4,25 +4,39 @@
android:layout_height="148dp"
android:orientation="vertical">
- <View
- android:layout_width="wrap_content"
- android:layout_height="@dimen/dp_8" />
+ <LinearLayout
+ android:id="@+id/move_ll"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:orientation="vertical">
- <ImageView
- android:id="@+id/move_home_iv"
- android:layout_width="@dimen/dp_50"
- android:layout_height="@dimen/dp_50"
- android:src="@drawable/move_house" />
+ <ImageView
+ android:id="@+id/move_home_iv"
+ android:layout_width="@dimen/dp_50"
+ android:layout_height="@dimen/dp_50"
+ android:src="@drawable/move_house" />
- <View
- android:layout_width="wrap_content"
- android:layout_height="@dimen/dp_32" />
+ </LinearLayout>
- <ImageView
- android:id="@+id/del_home_iv"
- android:layout_width="@dimen/dp_50"
- android:layout_height="@dimen/dp_50"
- android:src="@drawable/del_home" />
+ <LinearLayout
+ android:id="@+id/del_ll"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:orientation="vertical">
+
+
+ <ImageView
+ android:id="@+id/del_home_iv"
+ android:layout_width="@dimen/dp_50"
+ android:layout_height="@dimen/dp_50"
+ android:src="@drawable/del_home" />
+
+
+ </LinearLayout>
</LinearLayout>
\ No newline at end of file
--
Gitblit v1.8.0