enhance: add delay to SubtitleList drag behavior for smoother seeking
This commit is contained in:
@@ -39,6 +39,7 @@ import bzh.ajaury.chombev.core.model.Phrase
|
|||||||
import bzh.ajaury.chombev.player.ui.components.TranscriptionText
|
import bzh.ajaury.chombev.player.ui.components.TranscriptionText
|
||||||
import bzh.ajaury.chombev.preferences.model.SubtitlePreferences
|
import bzh.ajaury.chombev.preferences.model.SubtitlePreferences
|
||||||
import bzh.ajaury.chombev.subtitle.model.SubtitleLine
|
import bzh.ajaury.chombev.subtitle.model.SubtitleLine
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.time.Duration.Companion.milliseconds
|
import kotlin.time.Duration.Companion.milliseconds
|
||||||
|
|
||||||
@@ -89,6 +90,8 @@ fun SubtitleList(
|
|||||||
onSeek(targetIndex)
|
onSeek(targetIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let some time for the player to seek before releasing
|
||||||
|
delay(100.milliseconds)
|
||||||
isDragging = false
|
isDragging = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user