2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Using collect() instead of java16-only toList() to fix crash

This commit is contained in:
Albert Vaca Cintora
2023-09-18 04:12:46 +02:00
parent 48919bddcd
commit 3baa9fa14e

View File

@@ -22,6 +22,7 @@ import org.kde.kdeconnect.Device
import org.kde.kdeconnect.KdeConnect import org.kde.kdeconnect.KdeConnect
import org.kde.kdeconnect_tp.R import org.kde.kdeconnect_tp.R
import org.kde.kdeconnect_tp.databinding.WidgetRemoteCommandPluginDialogBinding import org.kde.kdeconnect_tp.databinding.WidgetRemoteCommandPluginDialogBinding
import java.util.stream.Collectors
import kotlin.streams.toList import kotlin.streams.toList
class RunCommandWidgetConfigActivity : AppCompatActivity() { class RunCommandWidgetConfigActivity : AppCompatActivity() {
@@ -44,7 +45,7 @@ class RunCommandWidgetConfigActivity : AppCompatActivity() {
val binding = WidgetRemoteCommandPluginDialogBinding.inflate(layoutInflater) val binding = WidgetRemoteCommandPluginDialogBinding.inflate(layoutInflater)
setContentView(binding.root) setContentView(binding.root)
val pairedDevices = KdeConnect.getInstance().devices.values.stream().filter(Device::isPaired).toList() val pairedDevices = KdeConnect.getInstance().devices.values.stream().filter(Device::isPaired).collect(Collectors.toList());
binding.runCommandsDeviceList.adapter = object : ArrayAdapter<Device>(this, 0, pairedDevices) { binding.runCommandsDeviceList.adapter = object : ArrayAdapter<Device>(this, 0, pairedDevices) {
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {