zhuguifei
2026-01-14 82023c98e5c30d36966b85c10c43a6cb11f67e2c
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();
            }
        }