mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Properly handle seek bar input events.
This commit is contained in:
parent
692741f406
commit
7a9e73fb13
@ -246,12 +246,10 @@ public class AudioSlidePlayer implements SensorEventListener {
|
||||
}
|
||||
|
||||
public synchronized void seekTo(double progress) throws IOException {
|
||||
if (mediaPlayer == null) return;
|
||||
|
||||
if (isReady()) {
|
||||
mediaPlayer.seekTo((long) (mediaPlayer.getDuration() * progress));
|
||||
} else {
|
||||
if (mediaPlayer == null || !isReady()) {
|
||||
play(progress);
|
||||
} else {
|
||||
mediaPlayer.seekTo((long) (mediaPlayer.getDuration() * progress));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,9 +249,11 @@ class WaveformSeekBar : View {
|
||||
if (abs(event.x - touchDownX) > scaledTouchSlop) {
|
||||
updateProgress(event, false)
|
||||
}
|
||||
|
||||
performClick()
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL -> {
|
||||
userSeeking = false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user