all: reformat

This commit is contained in:
Alexander Capehart
2025-08-28 22:38:00 -06:00
parent da49e392b8
commit dc64757a69
2 changed files with 46 additions and 46 deletions
@@ -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,9 +72,12 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
circleClipTapView.visibility = INVISIBLE
// Set up gesture detection
gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
override fun onDown(e: MotionEvent) = true
})
gestureDetector =
GestureDetector(
context,
object : GestureDetector.SimpleOnGestureListener() {
override fun onDown(e: MotionEvent) = true
})
gestureDetector.setOnDoubleTapListener(this)
addOnLayoutChangeListener { view, _, _, _, _, _, _, _, _ ->
@@ -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,11 +243,12 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
val width = width
val tapX = e.x
val portion = when {
tapX < width * 0.33f -> DisplayPortion.LEFT_HALF
tapX > width * 0.67f -> DisplayPortion.RIGHT_HALF
else -> DisplayPortion.MIDDLE
}
val portion =
when {
tapX < width * 0.33f -> DisplayPortion.LEFT_HALF
tapX > width * 0.67f -> DisplayPortion.RIGHT_HALF
else -> DisplayPortion.MIDDLE
}
if (portion != DisplayPortion.MIDDLE) {
onDoubleTapStarted(portion)