[O] Skip setup step if already configured
This commit is contained in:
@@ -81,11 +81,13 @@ class MainActivity : AppCompatActivity()
|
|||||||
influx = prefs.createInflux()
|
influx = prefs.createInflux()
|
||||||
|
|
||||||
// Scan for devices
|
// Scan for devices
|
||||||
connectCallback.launch(intent<ActivityScan>())
|
if (prefs.chosenDevice == null) pairCallback.launch(intent<ActivityScan>())
|
||||||
|
else afterPair()
|
||||||
}
|
}
|
||||||
|
|
||||||
val connectCallback = actCallback {
|
val pairCallback = actCallback { afterPair() }
|
||||||
addRecord("Device connected")
|
fun afterPair() {
|
||||||
|
addRecord("Device configured")
|
||||||
|
|
||||||
// Start collection
|
// Start collection
|
||||||
binding.content.tvDevice.text = "Configured Device: ${prefs.chosenDevice}"
|
binding.content.tvDevice.text = "Configured Device: ${prefs.chosenDevice}"
|
||||||
|
|||||||
Reference in New Issue
Block a user