Skip to content

Commit 2f26055

Browse files
Okuro3499dogi
andauthored
connect: all bluetooth devices clickable (fixes #1937) (#1938)
Co-authored-by: dogi <[email protected]>
1 parent c4ef49b commit 2f26055

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Diff for: app/src/main/kotlin/io/treehouses/remote/fragments/dialogfragments/RPIDialogFragment.kt

+4-8
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,10 @@ class RPIDialogFragment : BaseDialogFragment(), DeviceDeleteListener {
123123
private fun listViewOnClickListener(mView: View) {
124124
bind!!.listView.onItemClickListener = OnItemClickListener { _: AdapterView<*>?, _: View?, position: Int, _: Long ->
125125
val deviceList: List<BluetoothDevice> = if (bind!!.rpiSwitch.isChecked) raspberryDevices else allDevices
126-
if (checkPiAddress(deviceList[position].address)) {
127-
viewModel.connect(deviceList[position])
128-
mDialog!!.cancel()
129-
finish(mView)
130-
logD("Connecting Bluetooth. Position: $position ;; Status: ${viewModel.connectionStatus.value}")
131-
} else {
132-
Toast.makeText(context, "Device Unsupported", Toast.LENGTH_LONG).show()
133-
}
126+
viewModel.connect(deviceList[position])
127+
mDialog!!.cancel()
128+
finish(mView)
129+
logD("Connecting Bluetooth. Position: $position ;; Status: ${viewModel.connectionStatus.value}")
134130
}
135131
}
136132

0 commit comments

Comments
 (0)