diff --git a/app/src/main/java/org/linphone/activities/call/views/AnswerDeclineIncomingCallButtons.kt b/app/src/main/java/org/linphone/activities/call/views/AnswerDeclineIncomingCallButtons.kt index fb20b1184..f866faa43 100644 --- a/app/src/main/java/org/linphone/activities/call/views/AnswerDeclineIncomingCallButtons.kt +++ b/app/src/main/java/org/linphone/activities/call/views/AnswerDeclineIncomingCallButtons.kt @@ -19,12 +19,15 @@ */ package org.linphone.activities.call.views +import android.animation.AnimatorSet +import android.animation.ObjectAnimator import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater import android.view.MotionEvent import android.view.View import android.view.View.OnTouchListener +import android.view.animation.LinearInterpolator import android.widget.LinearLayout import androidx.databinding.DataBindingUtil import org.linphone.R @@ -121,6 +124,7 @@ class AnswerDeclineIncomingCallButtons : LinearLayout { ) updateSlideMode() + configureAnimation() } private fun updateSlideMode() { @@ -131,4 +135,43 @@ class AnswerDeclineIncomingCallButtons : LinearLayout { binding.declineButton.setOnTouchListener(mDeclineTouchListener) } } + + private fun configureAnimation() { + val accept1 = ObjectAnimator.ofFloat(binding.arrowAccept1, "alpha", 1f, 0.6f, 0.4f, 1f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + val accept2 = ObjectAnimator.ofFloat(binding.arrowAccept2, "alpha", 0.6f, 1f, 0.4f, 0.6f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + val accept3 = ObjectAnimator.ofFloat(binding.arrowAccept3, "alpha", 0.4f, 0.6f, 1f, 0.4f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + val hangup1 = ObjectAnimator.ofFloat(binding.arrowHangup1, "alpha", 1f, 0.6f, 0.4f, 1f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + val hangup2 = ObjectAnimator.ofFloat(binding.arrowHangup2, "alpha", 0.6f, 1f, 0.4f, 0.6f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + val hangup3 = ObjectAnimator.ofFloat(binding.arrowHangup3, "alpha", 0.4f, 0.6f, 1f, 0.4f).apply { + repeatCount = ObjectAnimator.INFINITE + repeatMode = ObjectAnimator.RESTART + } + + AnimatorSet().apply { + duration = 2000 + interpolator = LinearInterpolator() + playTogether(accept1, accept2, accept3, hangup1, hangup2, hangup3) + start() + } + } } diff --git a/app/src/main/res/layout/call_incoming_answer_decline_buttons.xml b/app/src/main/res/layout/call_incoming_answer_decline_buttons.xml index e0d1fc11e..2472f4c6a 100644 --- a/app/src/main/res/layout/call_incoming_answer_decline_buttons.xml +++ b/app/src/main/res/layout/call_incoming_answer_decline_buttons.xml @@ -42,25 +42,25 @@ android:orientation="horizontal"> + android:layout_height="wrap_content"/> + android:layout_height="wrap_content"/> @@ -88,20 +88,21 @@ android:orientation="horizontal"> + android:layout_height="wrap_content"/> + android:layout_height="wrap_content"/>