From 2f26055a313ed7b7442b0141df410742b5e9f001 Mon Sep 17 00:00:00 2001 From: Gideon Okuro Date: Fri, 29 Mar 2024 21:49:56 +0300 Subject: [PATCH] connect: all bluetooth devices clickable (fixes #1937) (#1938) Co-authored-by: dogi --- .../fragments/dialogfragments/RPIDialogFragment.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/io/treehouses/remote/fragments/dialogfragments/RPIDialogFragment.kt b/app/src/main/kotlin/io/treehouses/remote/fragments/dialogfragments/RPIDialogFragment.kt index 74879652b..fc6e5b105 100644 --- a/app/src/main/kotlin/io/treehouses/remote/fragments/dialogfragments/RPIDialogFragment.kt +++ b/app/src/main/kotlin/io/treehouses/remote/fragments/dialogfragments/RPIDialogFragment.kt @@ -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 = 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}") } }