Commit 361241f8 by olly Committed by Oliver Woodman

Make SeekBar work properly with key events if focusable

This isn't perfect because it performs seeks whilst the
user is holding down L/R, rather than when they release
it. Performing the seek on release properly looks non
trivial, and would likely require extending SeekBar.

Issue: #2278

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143440580
parent 04968a6d
......@@ -735,8 +735,14 @@ public class PlaybackControlView extends FrameLayout {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser && positionView != null) {
positionView.setText(stringForTime(positionValue(progress)));
if (fromUser) {
long position = positionValue(progress);
if (positionView != null) {
positionView.setText(stringForTime(position));
}
if (player != null && !dragging) {
seekTo(position);
}
}
}
......
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 sign in to comment