Fixed "Changing the seeks duration does not update the displayed seconds"
This commit is contained in:
parent
54ef604569
commit
af79479716
|
@ -586,7 +586,8 @@ public final class Player implements
|
|||
*/
|
||||
private void setupPlayerSeekOverlay() {
|
||||
binding.fastSeekOverlay
|
||||
.seekSeconds((int) (retrieveSeekDurationFromPreferences(this) / 1000.0f))
|
||||
.seekSecondsSupplier(
|
||||
() -> (int) (retrieveSeekDurationFromPreferences(this) / 1000.0f))
|
||||
.performListener(new PlayerFastSeekOverlay.PerformListener() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,11 +42,10 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
|||
performListener = listener
|
||||
}
|
||||
|
||||
var seekSeconds: Int = 0
|
||||
private set
|
||||
private var seekSecondsSupplier: () -> Int = { 0 }
|
||||
|
||||
fun seekSeconds(seconds: Int) = apply {
|
||||
seekSeconds = seconds
|
||||
fun seekSecondsSupplier(supplier: () -> Int) = apply {
|
||||
seekSecondsSupplier = supplier
|
||||
}
|
||||
|
||||
// Indicates whether this (double) tap is the first of a series
|
||||
|
@ -94,7 +93,7 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
|||
|
||||
performListener?.onDoubleTap()
|
||||
|
||||
secondsView.seconds += seekSeconds
|
||||
secondsView.seconds += seekSecondsSupplier.invoke()
|
||||
performListener?.seek(forward = shouldForward)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue