Skip to content

Commit

Permalink
connect: all bluetooth devices clickable (fixes #1937) (#1938)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Mar 29, 2024
1 parent c4ef49b commit 2f26055
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,10 @@ class RPIDialogFragment : BaseDialogFragment(), DeviceDeleteListener {
private fun listViewOnClickListener(mView: View) {
bind!!.listView.onItemClickListener = OnItemClickListener { _: AdapterView<*>?, _: View?, position: Int, _: Long ->
val deviceList: List<BluetoothDevice> = if (bind!!.rpiSwitch.isChecked) raspberryDevices else allDevices
if (checkPiAddress(deviceList[position].address)) {
viewModel.connect(deviceList[position])
mDialog!!.cancel()
finish(mView)
logD("Connecting Bluetooth. Position: $position ;; Status: ${viewModel.connectionStatus.value}")
} else {
Toast.makeText(context, "Device Unsupported", Toast.LENGTH_LONG).show()
}
viewModel.connect(deviceList[position])
mDialog!!.cancel()
finish(mView)
logD("Connecting Bluetooth. Position: $position ;; Status: ${viewModel.connectionStatus.value}")
}
}

Expand Down

0 comments on commit 2f26055

Please sign in to comment.