Search in sources :

Example 91 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project UnityModManager by xausky.

the class FabBehavior method show.

// 显示时的动画
private void show(final View view) {
    ViewPropertyAnimator animator = view.animate().translationY(0).setInterpolator(INTERPOLATOR).setDuration(200);
    animator.setListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
            view.setVisibility(View.VISIBLE);
            isAnimate = true;
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            isAnimate = false;
        }

        @Override
        public void onAnimationCancel(Animator animator) {
            hide(view);
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    animator.start();
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 92 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project aos-MediaLib by nova-video-player.

the class GlobalResumeView method launchOpenAnimation.

public void launchOpenAnimation(AnimatorListener listener) {
    ViewPropertyAnimator a = animate();
    a.scaleX(5f).scaleY(5f).alpha(0f);
    a.setDuration(300);
    a.setListener(listener);
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 93 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project android-test by android.

the class ScaledViewActivity method setupView.

private void setupView() {
    setContentView(R.layout.scaledview_activity);
    View scaledView = findViewById(R.id.scaled_view);
    scaledView.setOnClickListener(new View.OnClickListener() {

        private boolean scaled = false;

        @Override
        public void onClick(View v) {
            ViewPropertyAnimator animator = v.animate();
            animator.cancel();
            if (scaled) {
                animator.scaleX(1f).scaleY(1f).start();
                scaled = !scaled;
            } else {
                animator.scaleX(0.5f).scaleY(0.5f).start();
                scaled = !scaled;
            }
        }
    });
}
Also used : View(android.view.View) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 94 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project mTHMMY by ThmmyNoLife.

the class ScrollAwareLinearBehavior method hide.

/**
 * Animates the hiding of a bottom navigation bar.
 *
 * @param bottomNavBar bottom navigation bar View
 */
private void hide(final View bottomNavBar) {
    ViewPropertyAnimator animator = bottomNavBar.animate().translationY(bottomNavBar.getHeight()).setInterpolator(new FastOutSlowInInterpolator()).setDuration(ANIMATION_DURATION);
    animator.setListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            bottomNavBar.setVisibility(View.INVISIBLE);
        }

        @Override
        public void onAnimationCancel(Animator animator) {
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    animator.start();
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 95 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project mTHMMY by ThmmyNoLife.

the class EditorView method hideMarkdown.

/**
 * Animates the hiding of the markdown options.
 */
public void hideMarkdown() {
    if (formatButtonsRecyclerview.getVisibility() == GONE)
        return;
    ViewPropertyAnimator animator = formatButtonsRecyclerview.animate().translationY(formatButtonsRecyclerview.getHeight()).setInterpolator(new FastOutSlowInInterpolator()).setDuration(ANIMATION_DURATION);
    animator.setListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            formatButtonsRecyclerview.setVisibility(View.GONE);
        }

        @Override
        public void onAnimationCancel(Animator animator) {
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    animator.start();
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

ViewPropertyAnimator (android.view.ViewPropertyAnimator)104 Animator (android.animation.Animator)59 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)36 View (android.view.View)30 ValueAnimator (android.animation.ValueAnimator)23 ObjectAnimator (android.animation.ObjectAnimator)11 RecyclerView (androidx.recyclerview.widget.RecyclerView)9 AnimatorListener (android.animation.Animator.AnimatorListener)8 SimpleItemAnimator (androidx.recyclerview.widget.SimpleItemAnimator)7 SimpleItemAnimator (android.support.v7.widget.SimpleItemAnimator)4 ViewGroup (android.view.ViewGroup)4 ImageView (android.widget.ImageView)4 FastOutSlowInInterpolator (androidx.interpolator.view.animation.FastOutSlowInInterpolator)4 ProgressCardView (org.wikipedia.feed.progress.ProgressCardView)4 Paint (android.graphics.Paint)3 ViewTreeObserver (android.view.ViewTreeObserver)3 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)3 DialogCell (org.telegram.ui.Cells.DialogCell)3 Point (android.graphics.Point)2