Search in sources :

Example 6 with AnimationCompleteListener

use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.

the class ConversationItemFooter method showPlaybackSpeedToggle.

private void showPlaybackSpeedToggle() {
    if (hasShrunkDate) {
        return;
    }
    hasShrunkDate = true;
    playbackSpeedToggleTextView.animate().alpha(1f).scaleX(1f).scaleY(1f).setDuration(150L).setListener(new AnimationCompleteListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            playbackSpeedToggleTextView.setClickable(true);
        }
    });
    if (isOutgoing) {
        dateView.setMaxWidth(ViewUtil.dpToPx(28));
    } else {
        ConstraintSet constraintSet = new ConstraintSet();
        constraintSet.clone(this);
        constraintSet.constrainMaxWidth(R.id.date_and_expiry_wrapper, ViewUtil.dpToPx(40));
        constraintSet.applyTo(this);
    }
}
Also used : Animator(android.animation.Animator) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener)

Example 7 with AnimationCompleteListener

use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.

the class ConversationItemFooter method hidePlaybackSpeedToggle.

private void hidePlaybackSpeedToggle() {
    if (!hasShrunkDate) {
        return;
    }
    hasShrunkDate = false;
    playbackSpeedToggleTextView.animate().alpha(0f).scaleX(0.5f).scaleY(0.5f).setDuration(150L).setListener(new AnimationCompleteListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            playbackSpeedToggleTextView.setClickable(false);
            playbackSpeedToggleTextView.clearRequestedSpeed();
        }
    });
    if (isOutgoing) {
        dateView.setMaxWidth(Integer.MAX_VALUE);
    } else {
        ConstraintSet constraintSet = new ConstraintSet();
        constraintSet.clone(this);
        constraintSet.constrainMaxWidth(R.id.date_and_expiry_wrapper, -1);
        constraintSet.applyTo(this);
    }
}
Also used : Animator(android.animation.Animator) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener)

Example 8 with AnimationCompleteListener

use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.

the class PictureInPictureGestureHelper method fling.

private void fling() {
    Point projection = new Point((int) projectionX, (int) projectionY);
    Point nearestCornerPosition = findNearestCornerPosition(projection);
    isAnimating = true;
    isDragging = false;
    child.animate().translationX(getTranslationXForPoint(nearestCornerPosition)).translationY(getTranslationYForPoint(nearestCornerPosition)).setDuration(250).setInterpolator(interpolator).setListener(new AnimationCompleteListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            isAnimating = false;
            Iterator<Runnable> afterFlingRunnables = runAfterFling.iterator();
            while (afterFlingRunnables.hasNext()) {
                Runnable runnable = afterFlingRunnables.next();
                runnable.run();
                afterFlingRunnables.remove();
            }
        }
    }).start();
}
Also used : Animator(android.animation.Animator) Point(android.graphics.Point) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener)

Example 9 with AnimationCompleteListener

use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.

the class SearchToolbar method hide.

@MainThread
private void hide() {
    if (getVisibility() == View.VISIBLE) {
        if (listener != null)
            listener.onSearchClosed();
        if (Build.VERSION.SDK_INT >= 21) {
            Animator animator = ViewAnimationUtils.createCircularReveal(this, (int) x, (int) y, getWidth(), 0);
            animator.setDuration(400);
            animator.addListener(new AnimationCompleteListener() {

                @Override
                public void onAnimationEnd(Animator animation) {
                    setVisibility(View.INVISIBLE);
                }
            });
            animator.start();
        } else {
            setVisibility(View.INVISIBLE);
        }
    }
}
Also used : Animator(android.animation.Animator) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener) MainThread(androidx.annotation.MainThread)

Example 10 with AnimationCompleteListener

use of org.thoughtcrime.securesms.animation.AnimationCompleteListener in project Signal-Android by signalapp.

the class CameraXFragment method fadeOutControls.

@Override
public void fadeOutControls(@NonNull Runnable onEndAction) {
    controlsContainer.setEnabled(false);
    controlsContainer.animate().setDuration(250).alpha(0f).setInterpolator(MediaAnimations.getInterpolator()).setListener(new AnimationCompleteListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            controlsContainer.setEnabled(true);
            onEndAction.run();
        }
    });
}
Also used : Animator(android.animation.Animator) AnimationCompleteListener(org.thoughtcrime.securesms.animation.AnimationCompleteListener)

Aggregations

Animator (android.animation.Animator)28 AnimationCompleteListener (org.thoughtcrime.securesms.animation.AnimationCompleteListener)28 AnimatorSet (android.animation.AnimatorSet)4 ObjectAnimator (android.animation.ObjectAnimator)4 ValueAnimator (android.animation.ValueAnimator)4 View (android.view.View)4 OvershootInterpolator (android.view.animation.OvershootInterpolator)4 NonNull (androidx.annotation.NonNull)4 ConstraintSet (androidx.constraintlayout.widget.ConstraintSet)4 LottieAnimationView (com.airbnb.lottie.LottieAnimationView)4 TextPaint (android.text.TextPaint)3 SuppressLint (android.annotation.SuppressLint)2 Activity (android.app.Activity)2 Point (android.graphics.Point)2 TextView (android.widget.TextView)2 MainThread (androidx.annotation.MainThread)2 RawRes (androidx.annotation.RawRes)2 AlertDialog (androidx.appcompat.app.AlertDialog)2 HintConstants (androidx.autofill.HintConstants)2 ContextCompat (androidx.core.content.ContextCompat)2