mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-11 03:56:23 +00:00
casting: undo even more formatting
This commit is contained in:
parent
feeba10429
commit
f21ed9aa2a
3 changed files with 10 additions and 14 deletions
|
@ -183,21 +183,19 @@ class ConnectCastingDialog(context: Context?) : AlertDialog(context) {
|
|||
}
|
||||
|
||||
private fun buildUnifiedList(): List<DeviceAdapterEntry> {
|
||||
val unifiedList = mutableListOf<DeviceAdapterEntry>()
|
||||
|
||||
val onlineDevices = StateCasting.instance.devices.values.associateBy { it.name }
|
||||
val rememberedDevices = StateCasting.instance.getRememberedCastingDevices().associateBy { it.name }
|
||||
|
||||
val unifiedList = mutableListOf<DeviceAdapterEntry>()
|
||||
|
||||
val intersectionNames = _devices.intersect(_rememberedDevices)
|
||||
for (name in intersectionNames) {
|
||||
onlineDevices[name]?.let { unifiedList.add(DeviceAdapterEntry(it, true, true)
|
||||
)
|
||||
}
|
||||
onlineDevices[name]?.let { unifiedList.add(DeviceAdapterEntry(it, true, true)) }
|
||||
}
|
||||
|
||||
val onlineOnlyNames = _devices - _rememberedDevices
|
||||
for (name in onlineOnlyNames) {
|
||||
onlineDevices[name]?.let { unifiedList.add(DeviceAdapterEntry(it, false, true )) }
|
||||
onlineDevices[name]?.let { unifiedList.add(DeviceAdapterEntry(it, false, true)) }
|
||||
}
|
||||
|
||||
val rememberedOnlyNames = _rememberedDevices - _devices
|
||||
|
|
|
@ -122,7 +122,7 @@ class ConnectedCastingDialog(context: Context?) : AlertDialog(context) {
|
|||
super.show();
|
||||
Logger.i(TAG, "Dialog shown.");
|
||||
|
||||
StateCasting.instance.onActiveDeviceVolumeChanged.remove(this)
|
||||
StateCasting.instance.onActiveDeviceVolumeChanged.remove(this);
|
||||
StateCasting.instance.onActiveDeviceVolumeChanged.subscribe {
|
||||
_sliderVolume.value = it.toFloat().coerceAtLeast(0.0f).coerceAtMost(_sliderVolume.valueTo);
|
||||
};
|
||||
|
@ -139,12 +139,10 @@ class ConnectedCastingDialog(context: Context?) : AlertDialog(context) {
|
|||
_sliderPosition.valueTo = dur
|
||||
};
|
||||
|
||||
val ad = StateCasting.instance.activeDevice
|
||||
if (ad != null) {
|
||||
_device = ad
|
||||
}
|
||||
val isConnected = ad != null && ad.connectionState == CastConnectionState.CONNECTED
|
||||
setLoading(!isConnected)
|
||||
_device = StateCasting.instance.activeDevice;
|
||||
val d = _device;
|
||||
val isConnected = d != null && d.connectionState == CastConnectionState.CONNECTED;
|
||||
setLoading(!isConnected);
|
||||
StateCasting.instance.onActiveDeviceConnectionStateChanged.subscribe(this) { _, connectionState ->
|
||||
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) { setLoading(connectionState != CastConnectionState.CONNECTED); };
|
||||
updateDevice();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8cff240ca7e9089ab26c03f78b6104d9cc2162fe
|
||||
Subproject commit 089987f007319cf22972090a0cb09afd8c008adb
|
Loading…
Add table
Add a link
Reference in a new issue