Fixed MusicSeekSkipTouchListener
This commit is contained in:
parent
87f1172481
commit
b47029cb57
1 changed files with 4 additions and 2 deletions
|
@ -45,9 +45,9 @@ class MusicSeekSkipTouchListener(val activity: FragmentActivity, val next: Boole
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
||||||
val action = event?.actionMasked
|
val action = event?.actionMasked
|
||||||
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
|
if (action == MotionEvent.ACTION_UP) {
|
||||||
job?.cancel()
|
job?.cancel()
|
||||||
if (!wasSeeking) {
|
if (v?.isPressed == true && !wasSeeking) {
|
||||||
if (next) {
|
if (next) {
|
||||||
MusicPlayerRemote.playNextSong()
|
MusicPlayerRemote.playNextSong()
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,6 +55,8 @@ class MusicSeekSkipTouchListener(val activity: FragmentActivity, val next: Boole
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wasSeeking = false
|
wasSeeking = false
|
||||||
|
} else if (action == MotionEvent.ACTION_CANCEL) {
|
||||||
|
job?.cancel()
|
||||||
}
|
}
|
||||||
return gestureDetector.onTouchEvent(event)
|
return gestureDetector.onTouchEvent(event)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue