From 748e302167a333b08fb5813b6f48806210e53091 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 29 五月 2024 11:49:29 +0800
Subject: [PATCH] 2024年05月29日11:49:20

---
 app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java
index 14fd13f..045b1b8 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java
@@ -179,6 +179,16 @@
             @Override
             public void onClick(int position, String title) {
                 viewBinding.powerStationSearchEt.setText(title);
+                //鎼滅储鍏抽敭瀛�
+                currSearchText = viewBinding.powerStationSearchEt.getText().toString().replace(" ", "");
+                if (TextUtils.isEmpty(currSearchText)) {
+                    HdlThreadLogic.toast(_mActivity, R.string.search_content_null);
+                    return;
+                }
+                viewBinding.historyListParent.setVisibility(View.GONE);
+                viewBinding.listParent.setVisibility(View.VISIBLE);
+                addSearchTextToList();
+                loadNextPageHouseList(true, 1, true);
             }
         });
         //璁惧鐐瑰嚮鏄簨浠�
@@ -402,9 +412,10 @@
         searchHistoryTitleList.add(currSearchText);
         // 鍊掑簭鎺掑垪鏁版嵁(鎼滅储鏈�鍚庢帓鍦ㄥ墠闈�)
         Collections.reverse(searchHistoryTitleList);
-        if (searchHistoryTitleList.size() > 10) {
+        int maxValue = 10;
+        if (searchHistoryTitleList.size() > maxValue) {
             //鍘嗗彶璁板綍涓嶈兘瓒呭嚭10
-            searchHistoryTitleList.remove(searchHistoryTitleList.get(11));
+            searchHistoryTitleList.remove(searchHistoryTitleList.get(maxValue));
         }
 
     }

--
Gitblit v1.8.0