improve boolean condition

This commit is contained in:
Florian Renaud 2022-11-14 11:57:05 +01:00
parent 288fc35487
commit 403fd9260e

View file

@ -130,7 +130,7 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
listeners[voiceBroadcast.voiceBroadcastId] = CopyOnWriteArrayList<Listener>().apply { add(listener) } listeners[voiceBroadcast.voiceBroadcastId] = CopyOnWriteArrayList<Listener>().apply { add(listener) }
} }
listener.onPlayingStateChanged(if (voiceBroadcast == currentVoiceBroadcast) playingState else State.IDLE) listener.onPlayingStateChanged(if (voiceBroadcast == currentVoiceBroadcast) playingState else State.IDLE)
listener.onLiveModeChanged(if (voiceBroadcast == currentVoiceBroadcast) isLiveListening else false) listener.onLiveModeChanged(voiceBroadcast == currentVoiceBroadcast && isLiveListening)
} }
override fun removeListener(voiceBroadcast: VoiceBroadcast, listener: Listener) { override fun removeListener(voiceBroadcast: VoiceBroadcast, listener: Listener) {