From 6203f736cba5abf3286e714fd9b515e34eb52fd4 Mon Sep 17 00:00:00 2001 From: raphael Date: Mon, 19 Mar 2018 10:35:04 +0200 Subject: [PATCH] updated list on refresh --- .../java/com/phearme/btscanselector/BTScanResultItem.java | 6 +++--- .../com/phearme/btscanselector/BTScanSelectorViewModel.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/btscanselector/src/main/java/com/phearme/btscanselector/BTScanResultItem.java b/btscanselector/src/main/java/com/phearme/btscanselector/BTScanResultItem.java index 3958bf8..7759691 100644 --- a/btscanselector/src/main/java/com/phearme/btscanselector/BTScanResultItem.java +++ b/btscanselector/src/main/java/com/phearme/btscanselector/BTScanResultItem.java @@ -32,15 +32,15 @@ private void updateIconResId() { iconResourceId = R.drawable.network_high; return; } - if (rssi <= -50 && rssi > -67) { + if (rssi <= -50 && rssi > -70) { iconResourceId = R.drawable.network_medium; return; } - if (rssi <= -67 && rssi > -70) { + if (rssi <= -70 && rssi > -90) { iconResourceId = R.drawable.network_low; return; } - if (rssi <= -70) { + if (rssi <= -90) { iconResourceId = R.drawable.network_no_signal; return; } diff --git a/btscanselector/src/main/java/com/phearme/btscanselector/BTScanSelectorViewModel.java b/btscanselector/src/main/java/com/phearme/btscanselector/BTScanSelectorViewModel.java index 570c275..ca0e9cd 100644 --- a/btscanselector/src/main/java/com/phearme/btscanselector/BTScanSelectorViewModel.java +++ b/btscanselector/src/main/java/com/phearme/btscanselector/BTScanSelectorViewModel.java @@ -117,6 +117,7 @@ public int compare(BTScanResultItem btScanResultItem, BTScanResultItem t1) { void refresh() { if (!isScanning()) { + devices = new ArrayList<>(); BluetoothAdapter.getDefaultAdapter().startDiscovery(); } }