From 4c55bb771f966136c60b45cd1496ff02cc0c2ea1 Mon Sep 17 00:00:00 2001 From: Jannik Date: Sat, 16 Jul 2022 13:48:28 +0200 Subject: [PATCH] partially revert c34b95795f95306b128c352606e6b3d418ccb895 --- .../ui/activity/player/PlayerActivity.kt | 34 +++++++++++++- app/src/main/res/layout/activity_player.xml | 44 +++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt b/app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt index 59fd6ce..181b85c 100644 --- a/app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt +++ b/app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerActivity.kt @@ -385,14 +385,44 @@ class PlayerActivity : AppCompatActivity() { return (model.currentEpisode.nextEpisodeId != null && !model.currentEpisodeIsLastEpisode()) } + /** + * TODO set position of rewind/fast forward indicators programmatically + */ + private fun rewind() { model.seekToOffset(rwdTime) - controlsBinding.rwd10.runOnClickAnimation() + + // hide/show needed components + playerBinding.exoDoubleTapIndicator.visibility = View.VISIBLE + playerBinding.ffwd10Indicator.visibility = View.INVISIBLE + controlsBinding.rwd10.visibility = View.INVISIBLE + + playerBinding.rwd10Indicator.onAnimationEndCallback = { + playerBinding.exoDoubleTapIndicator.visibility = View.GONE + playerBinding.ffwd10Indicator.visibility = View.VISIBLE + controlsBinding.rwd10.visibility = View.VISIBLE + } + + // run animation + playerBinding.rwd10Indicator.runOnClickAnimation() } private fun fastForward() { model.seekToOffset(fwdTime) - controlsBinding.ffwd10.runOnClickAnimation() + + // hide/show needed components + playerBinding.exoDoubleTapIndicator.visibility = View.VISIBLE + playerBinding.rwd10Indicator.visibility = View.INVISIBLE + controlsBinding.ffwd10.visibility = View.INVISIBLE + + playerBinding.ffwd10Indicator.onAnimationEndCallback = { + playerBinding.exoDoubleTapIndicator.visibility = View.GONE + playerBinding.rwd10Indicator.visibility = View.VISIBLE + controlsBinding.ffwd10.visibility = View.VISIBLE + } + + // run animation + playerBinding.ffwd10Indicator.runOnClickAnimation() } private fun playNextEpisode() { diff --git a/app/src/main/res/layout/activity_player.xml b/app/src/main/res/layout/activity_player.xml index 3c89116..81699da 100644 --- a/app/src/main/res/layout/activity_player.xml +++ b/app/src/main/res/layout/activity_player.xml @@ -27,6 +27,50 @@ app:indicatorColor="@color/player_white" tools:visibility="visible" /> + + + + + + + + + + + + + + + + +