From 82023c98e5c30d36966b85c10c43a6cb11f67e2c Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期三, 14 一月 2026 11:16:22 +0800
Subject: [PATCH] 修复某些情况下选择蓝牙错乱问题

---
 app/src/main/java/com/shlb/comb/fragment/DeviceListFragment.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/com/shlb/comb/fragment/DeviceListFragment.java b/app/src/main/java/com/shlb/comb/fragment/DeviceListFragment.java
index d8df7be..3015ed5 100644
--- a/app/src/main/java/com/shlb/comb/fragment/DeviceListFragment.java
+++ b/app/src/main/java/com/shlb/comb/fragment/DeviceListFragment.java
@@ -57,6 +57,7 @@
 
     private QMUIEmptyView mEmptyView;
     private ListView homeList;
+    private android.widget.ProgressBar pbScanning;
     private BluetoothScanManager scanManager;
     private BluetoothLeDeviceStore mDeviceStore;
     private BluetoothUtils mBluetoothUtils;
@@ -87,6 +88,7 @@
         View view = inflater.inflate(R.layout.fragment_device_list, container, false);
         mEmptyView = view.findViewById(R.id.emptyView);
         homeList = view.findViewById(R.id.homeList);
+        pbScanning = view.findViewById(R.id.pb_scanning);
         return view;
     }
 
@@ -155,6 +157,7 @@
         scanManager.setScanOverListener(new ScanOverListener() {
             @Override
             public void onScanOver() {
+                if (pbScanning != null) pbScanning.setVisibility(View.GONE);
             }
         });
 
@@ -162,6 +165,7 @@
             @Override
             public void onScanFailed(final int errorCode) {
                 super.onScanFailed(errorCode);
+                if (pbScanning != null) pbScanning.setVisibility(View.GONE);
                 Toast.makeText(getContext(), "鎵弿澶辫触锛�" + errorCode, Toast.LENGTH_SHORT).show();
             }
 
@@ -207,6 +211,7 @@
                 mDeviceStore.clear();
                 EventBus.getDefault().post(new UpdateEvent(UpdateEvent.Type.SCAN_UPDATE));
                ((BaseActivity) getActivity()).Toast("寮�濮嬫壂鎻�...");
+                if (pbScanning != null) pbScanning.setVisibility(View.VISIBLE);
                 scanManager.startScanNow();
             }
         }

--
Gitblit v1.9.3