Search in sources :

Example 21 with AnimationCompleteListener

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

the class CameraXFragment method fadeInControls.

@Override
public void fadeInControls() {
    controlsContainer.setEnabled(false);
    controlsContainer.animate().setDuration(250).alpha(1f).setInterpolator(MediaAnimations.getInterpolator()).setListener(new AnimationCompleteListener() {

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

Example 22 with AnimationCompleteListener

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

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)

Example 23 with AnimationCompleteListener

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

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 24 with AnimationCompleteListener

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

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 25 with AnimationCompleteListener

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

the class Camera1Fragment method fadeInControls.

@Override
public void fadeInControls() {
    controlsContainer.setEnabled(false);
    controlsContainer.animate().setInterpolator(MediaAnimations.getInterpolator()).setDuration(250).alpha(1f).setListener(new AnimationCompleteListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            controlsContainer.setEnabled(true);
        }
    });
}
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