[Android] Fix Now playing and Audio Player icons animation on TV

Nicolas Pomepuy git at videolan.org
Wed Feb 9 14:56:38 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jan 17 12:56:25 2022 +0100| [a6d3d5334b7699be4bc660c4cf077fc7af15a503] | committer: Nicolas Pomepuy

Fix Now playing and Audio Player icons animation on TV

Fixes #2318

> https://code.videolan.org/videolan/vlc-android/commit/a6d3d5334b7699be4bc660c4cf077fc7af15a503
---

 .../src/main/java/org/videolan/television/ui/CardPresenter.kt           | 2 +-
 .../java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/television/src/main/java/org/videolan/television/ui/CardPresenter.kt b/application/television/src/main/java/org/videolan/television/ui/CardPresenter.kt
index 9e615e226..f3233c731 100644
--- a/application/television/src/main/java/org/videolan/television/ui/CardPresenter.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/CardPresenter.kt
@@ -175,7 +175,7 @@ class CardPresenter(private val context: Activity, private val isPoster: Boolean
             holder.cardView.badgeImage = badge
             badge.registerAnimationCallback(object : Animatable2Compat.AnimationCallback() {
                 override fun onAnimationEnd(drawable: Drawable?) {
-                    badge.start()
+                    holder.cardView.post { badge.start() }
                     super.onAnimationEnd(drawable)
                 }
             })
diff --git a/application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt b/application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt
index 15bb7b6bf..14e57c8e3 100644
--- a/application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/audioplayer/AudioPlayerActivity.kt
@@ -177,7 +177,7 @@ class AudioPlayerActivity : BaseTvActivity(),KeycodeListener  {
         val drawable = if (state.playing) playToPause else pauseToPlay
         binding.buttonPlay.setImageDrawable(drawable)
         if (state.playing != wasPlaying) {
-            drawable.start()
+            binding.buttonPlay.post { drawable.start() }
         }
 
         wasPlaying = state.playing



More information about the Android mailing list