Commit c6f25049 authored by Robert Stone's avatar Robert Stone
Browse files

Fix long press behavior in audio player

parent ce05ea61
Pipeline #99857 passed with stage
in 3 minutes and 58 seconds
......@@ -586,20 +586,10 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
handler.removeCallbacks(seekRunnable)
previewingSeek = false
if (event.eventTime - event.downTime < 1000) {
if (forward) onNextClick(v) else onPreviousClick(v)
} else {
if (forward) {
if (possibleSeek < playlistModel.length)
playlistModel.time = possibleSeek.toLong()
else
onNextClick(v)
} else {
if (possibleSeek > 0)
playlistModel.time = possibleSeek.toLong()
else
onPreviousClick(v)
}
if (event.eventTime - event.downTime > 1000) {
playlistModel.time = possibleSeek.toLong().coerceAtLeast(0).coerceAtMost(playlistModel.length)
v.isPressed = false
return true
}
return false
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment