all: reformat
This commit is contained in:
@@ -38,7 +38,6 @@ import org.oxycblt.auxio.list.ListViewModel
|
||||
import org.oxycblt.auxio.music.resolve
|
||||
import org.oxycblt.auxio.music.resolveNames
|
||||
import org.oxycblt.auxio.playback.state.RepeatMode
|
||||
import org.oxycblt.auxio.playback.ui.ControlledCoverView
|
||||
import org.oxycblt.auxio.playback.ui.StyledSeekBar
|
||||
import org.oxycblt.auxio.playback.ui.stepper.DisplayPortion
|
||||
import org.oxycblt.auxio.playback.ui.stepper.PlayerFastSeekOverlay
|
||||
@@ -214,7 +213,6 @@ class PlaybackPanelFragment :
|
||||
playbackModel.seekTo(positionDs)
|
||||
}
|
||||
|
||||
|
||||
private fun updateSong(song: Song?) {
|
||||
if (song == null) {
|
||||
// Nothing to do.
|
||||
@@ -278,11 +276,15 @@ class PlaybackPanelFragment :
|
||||
// Animation cleanup is handled by the overlay
|
||||
}
|
||||
|
||||
override fun getFastSeekDirection(portion: DisplayPortion): PlayerFastSeekOverlay.PerformListener.FastSeekDirection {
|
||||
override fun getFastSeekDirection(
|
||||
portion: DisplayPortion
|
||||
): PlayerFastSeekOverlay.PerformListener.FastSeekDirection {
|
||||
return when (portion) {
|
||||
DisplayPortion.LEFT, DisplayPortion.LEFT_HALF ->
|
||||
DisplayPortion.LEFT,
|
||||
DisplayPortion.LEFT_HALF ->
|
||||
PlayerFastSeekOverlay.PerformListener.FastSeekDirection.BACKWARD
|
||||
DisplayPortion.RIGHT, DisplayPortion.RIGHT_HALF ->
|
||||
DisplayPortion.RIGHT,
|
||||
DisplayPortion.RIGHT_HALF ->
|
||||
PlayerFastSeekOverlay.PerformListener.FastSeekDirection.FORWARD
|
||||
else -> PlayerFastSeekOverlay.PerformListener.FastSeekDirection.NONE
|
||||
}
|
||||
|
||||
@@ -72,7 +72,10 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
||||
circleClipTapView.visibility = INVISIBLE
|
||||
|
||||
// Set up gesture detection
|
||||
gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
|
||||
gestureDetector =
|
||||
GestureDetector(
|
||||
context,
|
||||
object : GestureDetector.SimpleOnGestureListener() {
|
||||
override fun onDown(e: MotionEvent) = true
|
||||
})
|
||||
gestureDetector.setOnDoubleTapListener(this)
|
||||
@@ -145,15 +148,13 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
||||
isAnimatingIn = true
|
||||
secondsView.visibility = VISIBLE
|
||||
circleClipTapView.visibility = VISIBLE
|
||||
secondsView.animate()
|
||||
secondsView
|
||||
.animate()
|
||||
.alpha(1f)
|
||||
.setDuration(200)
|
||||
.withEndAction { isAnimatingIn = false }
|
||||
.start()
|
||||
circleClipTapView.animate()
|
||||
.alpha(1f)
|
||||
.setDuration(200)
|
||||
.start()
|
||||
circleClipTapView.animate().alpha(1f).setDuration(200).start()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -181,26 +182,22 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
||||
secondsView.stopAnimation()
|
||||
|
||||
// Cancel any existing fade out
|
||||
fadeOutRunnable?.let {
|
||||
removeCallbacks(it)
|
||||
}
|
||||
fadeOutRunnable?.let { removeCallbacks(it) }
|
||||
|
||||
// Schedule fade out overlay after a delay
|
||||
fadeOutRunnable = Runnable {
|
||||
isAnimatingIn = false
|
||||
secondsView.animate()
|
||||
secondsView
|
||||
.animate()
|
||||
.alpha(0f)
|
||||
.setDuration(200)
|
||||
.withEndAction {
|
||||
secondsView.visibility = INVISIBLE
|
||||
}
|
||||
.withEndAction { secondsView.visibility = INVISIBLE }
|
||||
.start()
|
||||
circleClipTapView.animate()
|
||||
circleClipTapView
|
||||
.animate()
|
||||
.alpha(0f)
|
||||
.setDuration(200)
|
||||
.withEndAction {
|
||||
circleClipTapView.visibility = INVISIBLE
|
||||
}
|
||||
.withEndAction { circleClipTapView.visibility = INVISIBLE }
|
||||
.start()
|
||||
fadeOutRunnable = null
|
||||
}
|
||||
@@ -246,7 +243,8 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
|
||||
val width = width
|
||||
val tapX = e.x
|
||||
|
||||
val portion = when {
|
||||
val portion =
|
||||
when {
|
||||
tapX < width * 0.33f -> DisplayPortion.LEFT_HALF
|
||||
tapX > width * 0.67f -> DisplayPortion.RIGHT_HALF
|
||||
else -> DisplayPortion.MIDDLE
|
||||
|
||||
Reference in New Issue
Block a user