[Android] Fix seek animation

Nicolas Pomepuy git at videolan.org
Wed Aug 12 14:04:20 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Aug 12 13:09:36 2020 +0200| [49de9423ee80c19ce0e84bffd7ee19023e423eaf] | committer: Nicolas Pomepuy

Fix seek animation

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

 application/vlc-android/res/layout/player_overlay_seek.xml   |  2 ++
 .../src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt     | 12 +++++-------
 .../src/org/videolan/vlc/gui/view/HalfCircleView.kt          |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/application/vlc-android/res/layout/player_overlay_seek.xml b/application/vlc-android/res/layout/player_overlay_seek.xml
index 6e4de56d9..3587f3cbc 100644
--- a/application/vlc-android/res/layout/player_overlay_seek.xml
+++ b/application/vlc-android/res/layout/player_overlay_seek.xml
@@ -50,6 +50,7 @@
             android:layout_height="0dp"
             android:layout_marginEnd="8dp"
             android:visibility="invisible"
+            android:background="@color/ripple_white"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="@id/guideline4"
             app:layout_constraintStart_toStartOf="parent"
@@ -61,6 +62,7 @@
             android:layout_height="0dp"
             android:layout_marginStart="8dp"
             android:visibility="invisible"
+            android:background="@color/ripple_white"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="@+id/guideline6"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 16d4a8c99..ae540e4d6 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -515,11 +515,8 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                 val cx = if (seekForward) container.width * 2 else -container.width
                 val cy = container.height / 2
                 animatorSet = AnimatorSet()
-                val circularReveal = CircularRevealCompat.createCircularReveal(container, cx.toFloat(), cy.toFloat(), 0F, container.width.toFloat() * 2)
-                val backgroundColorAnimator = ObjectAnimator.ofObject(container,
-                        CircularRevealWidget.CircularRevealScrimColorProperty.CIRCULAR_REVEAL_SCRIM_COLOR.name,
-                        ArgbEvaluator(),
-                        Color.TRANSPARENT, ContextCompat.getColor(player, R.color.ripple_white), Color.TRANSPARENT)
+                val backgroundColorAnimator = CircularRevealCompat.createCircularReveal(container, cx.toFloat(), cy.toFloat(), 0F, container.width.toFloat() * 2)
+                backgroundColorAnimator.duration = 750
 
                 val containerBackgroundAnim = ObjectAnimator.ofFloat(containerBackground, "alpha", 0f, 1f)
                 containerBackgroundAnim.duration = 300
@@ -530,7 +527,6 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                 val anims: ArrayList<Animator> = arrayListOf(firstImageAnim, secondImageAnim)
                 if (!isTv) {
                     anims.add(backgroundColorAnimator)
-                    anims.add(circularReveal)
                 }
                 if (!seekAnimRunning) {
                     anims.add(containerBackgroundAnim)
@@ -558,7 +554,9 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                 player.handler.removeMessages(VideoPlayerActivity.HIDE_SEEK)
                 player.handler.sendEmptyMessageDelayed(VideoPlayerActivity.HIDE_SEEK, SEEK_TIMEOUT)
 
-                container.visibility = View.VISIBLE
+                if (!isTv) {
+                    container.visibility = View.VISIBLE
+                }
                 seekAnimatorSet.start()
             }
             textView.text = sb.toString()
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt
index 6174de91b..54e6ece31 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/HalfCircleView.kt
@@ -52,7 +52,7 @@ class HalfCircleView : View {
         if (!Settings.showTvUi) {
             val cx = if (isLeft) -width else width * 2
             val cy = height / 2
-            canvas?.drawCircle(cx.toFloat(), cy.toFloat(), height.toFloat(), paint)
+            canvas?.drawCircle(cx.toFloat(), cy.toFloat(), width.toFloat()*2, paint)
         }
         super.onDraw(canvas)
     }



More information about the Android mailing list