[Android] Improve the circular effect
Nicolas Pomepuy
git at videolan.org
Thu May 23 15:39:40 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu May 23 11:46:53 2019 +0200| [b6df7a5ae3b6916f22536cc0fe3b4cedff913797] | committer: Geoffrey Métais
Improve the circular effect
> https://code.videolan.org/videolan/vlc-android/commit/b6df7a5ae3b6916f22536cc0fe3b4cedff913797
---
vlc-android/res/layout/player_overlay_seek.xml | 13 +++++++++----
vlc-android/res/values/colors.xml | 1 +
.../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 5 +++--
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/vlc-android/res/layout/player_overlay_seek.xml b/vlc-android/res/layout/player_overlay_seek.xml
index 5688b1e84..9468ddf9e 100644
--- a/vlc-android/res/layout/player_overlay_seek.xml
+++ b/vlc-android/res/layout/player_overlay_seek.xml
@@ -20,18 +20,19 @@
android:layout_marginBottom="8dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/right_container"
- app:layout_constraintStart_toStartOf="@+id/constraintLayout3"
+ app:layout_constraintEnd_toEndOf="@id/guideline4"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.circularreveal.CircularRevealFrameLayout
android:id="@+id/right_container"
android:layout_width="0dp"
android:layout_height="0dp"
+ android:layout_marginStart="8dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="@+id/guideline7"
+ app:layout_constraintStart_toStartOf="@+id/guideline6"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
@@ -48,11 +49,12 @@
android:id="@+id/seek_rewind_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:alpha="0"
android:src="@drawable/ic_half_seek_rewind"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/seek_rewind_first"
- app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -60,6 +62,7 @@
android:id="@+id/seek_rewind_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:alpha="0"
android:src="@drawable/ic_half_seek_rewind"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -95,6 +98,7 @@
android:id="@+id/seek_forward_first"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:alpha="0"
android:src="@drawable/ic_half_seek_forward"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/seek_forward_second"
@@ -107,6 +111,7 @@
android:id="@+id/seek_forward_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:alpha="0"
android:src="@drawable/ic_half_seek_forward"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/vlc-android/res/values/colors.xml b/vlc-android/res/values/colors.xml
index 5c3075dd9..e5d30bd42 100644
--- a/vlc-android/res/values/colors.xml
+++ b/vlc-android/res/values/colors.xml
@@ -47,6 +47,7 @@
<color name="blacktransparent">#b4000000</color>
<color name="whitetransparent">#b4ffffff</color>
+ <color name="ripple_white">#88ffffff</color>
<color name="transparent">#00000000</color>
<color name="white_selection_transparent">#44ffffff</color>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 663381bf7..20f2ec150 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -53,6 +53,7 @@ import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.PopupMenu
import androidx.appcompat.widget.ViewStubCompat
+import androidx.core.content.ContextCompat
import androidx.databinding.BindingAdapter
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
@@ -2161,13 +2162,13 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
val cx = if (seekForward) container.width else 0
val cy = container.height / 2
val animatorSet = AnimatorSet()
- val circularReveal = CircularRevealCompat.createCircularReveal(container, cx.toFloat(), cy.toFloat(), 0F, container.height.toFloat())
+ val circularReveal = CircularRevealCompat.createCircularReveal(container, cx.toFloat(), cy.toFloat(), 0F, container.width.toFloat())
val backgroundColorAnimator = ObjectAnimator.ofObject(container,
CircularRevealWidget.CircularRevealScrimColorProperty.CIRCULAR_REVEAL_SCRIM_COLOR.name,
ArgbEvaluator(),
- Color.TRANSPARENT, Color.WHITE, Color.TRANSPARENT)
+ Color.TRANSPARENT, ContextCompat.getColor(this, R.color.ripple_white), Color.TRANSPARENT)
animatorSet.playTogether(
More information about the Android
mailing list