From b85fcf9a005300ebf0c4116b2692bf0c982b3ca2 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Tue, 15 Nov 2022 00:11:16 +0100 Subject: [PATCH] Remove debounce on player buttons --- .../timeline/item/MessageVoiceBroadcastListeningItem.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceBroadcastListeningItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceBroadcastListeningItem.kt index 7c7e69f320..e5cb677763 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceBroadcastListeningItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageVoiceBroadcastListeningItem.kt @@ -60,7 +60,7 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem private fun bindButtons(holder: Holder) { with(holder) { - playPauseButton.onClick { + playPauseButton.setOnClickListener { if (player.currentVoiceBroadcast == voiceBroadcast) { when (player.playingState) { VoiceBroadcastPlayer.State.PLAYING -> callback?.onTimelineItemAction(VoiceBroadcastAction.Listening.Pause) @@ -72,11 +72,11 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem callback?.onTimelineItemAction(VoiceBroadcastAction.Listening.PlayOrResume(voiceBroadcast)) } } - fastBackwardButton.onClick { + fastBackwardButton.setOnClickListener { val newPos = seekBar.progress.minus(30_000).coerceIn(0, duration) callback?.onTimelineItemAction(VoiceBroadcastAction.Listening.SeekTo(voiceBroadcast, newPos, duration)) } - fastForwardButton.onClick { + fastForwardButton.setOnClickListener { val newPos = seekBar.progress.plus(30_000).coerceIn(0, duration) callback?.onTimelineItemAction(VoiceBroadcastAction.Listening.SeekTo(voiceBroadcast, newPos, duration)) } @@ -163,7 +163,7 @@ abstract class MessageVoiceBroadcastListeningItem : AbsMessageVoiceBroadcastItem player.removeListener(voiceBroadcast, playerListener) playbackTracker.untrack(voiceBroadcast.voiceBroadcastId) with(holder) { - seekBar.onClick(null) + seekBar.setOnSeekBarChangeListener(null) playPauseButton.onClick(null) fastForwardButton.onClick(null) fastBackwardButton.onClick(null)