Search in sources :

Example 71 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project TransitionHelper by ImmortalZ.

the class NoneShowMethod method translate.

@Override
public void translate(InfoBean bean, RenderView parent, View child) {
    startColor = parent.getResources().getColor(R.color.showmethod_start_color);
    endColor = parent.getResources().getColor(R.color.showmethod_end_color);
    set.setInterpolator(new AccelerateInterpolator());
    set.setDuration(duration).start();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 72 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project TransitionHelper by ImmortalZ.

the class ButtonActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TransitionsHeleper.getInstance().setShowMethod(new ColorShowMethod(R.color.bg_purple, R.color.bg_teal) {

        @Override
        public void loadCopyView(InfoBean bean, ImageView copyView) {
            AnimatorSet set = new AnimatorSet();
            set.playTogether(ObjectAnimator.ofFloat(copyView, "alpha", 1f, 0f), ObjectAnimator.ofFloat(copyView, "scaleX", 1.5f, 1f), ObjectAnimator.ofFloat(copyView, "scaleY", 1.5f, 1f));
            set.setInterpolator(new AccelerateInterpolator());
            set.setDuration(duration / 4 * 5).start();
        }

        @Override
        public void loadTargetView(InfoBean bean, ImageView targetView) {
        }
    }).show(this, null);
}
Also used : InfoBean(immortalz.me.library.bean.InfoBean) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ColorShowMethod(immortalz.me.library.method.ColorShowMethod) AnimatorSet(android.animation.AnimatorSet) ImageView(android.widget.ImageView)

Example 73 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project TransitionHelper by ImmortalZ.

the class FabCircleActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TransitionsHeleper.getInstance().setShowMethod(new ColorShowMethod(R.color.bg_purple, R.color.bg_teal) {

        @Override
        public void loadCopyView(InfoBean bean, ImageView copyView) {
            AnimatorSet set = new AnimatorSet();
            set.playTogether(ObjectAnimator.ofFloat(copyView, "rotation", 0, 180), ObjectAnimator.ofFloat(copyView, "scaleX", 1, 0), ObjectAnimator.ofFloat(copyView, "scaleY", 1, 0));
            set.setInterpolator(new AccelerateInterpolator());
            set.setDuration(duration / 4 * 5).start();
        }

        @Override
        public void loadTargetView(InfoBean bean, ImageView targetView) {
        }
    }).show(this, null);
}
Also used : InfoBean(immortalz.me.library.bean.InfoBean) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ColorShowMethod(immortalz.me.library.method.ColorShowMethod) AnimatorSet(android.animation.AnimatorSet) ImageView(android.widget.ImageView)

Example 74 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project TransitionHelper by ImmortalZ.

the class FabNoCircleActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TransitionsHeleper.getInstance().setShowMethod(new NoneShowMethod() {

        @Override
        public void loadCopyView(InfoBean bean, ImageView copyView) {
            AnimatorSet set = new AnimatorSet();
            set.playTogether(ObjectAnimator.ofFloat(copyView, "rotation", 0, 180), ObjectAnimator.ofFloat(copyView, "scaleX", 1, 0), ObjectAnimator.ofFloat(copyView, "scaleY", 1, 0));
            set.setInterpolator(new AccelerateInterpolator());
            set.setDuration(duration / 4 * 5).start();
        }
    }).show(this, null);
}
Also used : InfoBean(immortalz.me.library.bean.InfoBean) NoneShowMethod(immortalz.me.library.method.NoneShowMethod) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnimatorSet(android.animation.AnimatorSet) ImageView(android.widget.ImageView)

Example 75 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project AndroidDevelop by 7449.

the class BadgeView method init.

private void init(Context context, View target, int tabIndex) {
    this.context = context;
    this.target = target;
    this.targetTabIndex = tabIndex;
    badgePosition = DEFAULT_POSITION;
    badgeMarginH = dipToPixels(DEFAULT_MARGIN_DIP);
    badgeMarginV = badgeMarginH;
    badgeColor = DEFAULT_BADGE_COLOR;
    setTypeface(Typeface.DEFAULT_BOLD);
    int paddingPixels = dipToPixels(DEFAULT_LR_PADDING_DIP);
    setPadding(paddingPixels, 0, paddingPixels, 0);
    setTextColor(DEFAULT_TEXT_COLOR);
    fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setInterpolator(new DecelerateInterpolator());
    fadeIn.setDuration(200);
    fadeOut = new AlphaAnimation(1, 0);
    fadeOut.setInterpolator(new AccelerateInterpolator());
    fadeOut.setDuration(200);
    isShown = false;
    if (this.target != null) {
        applyTo(this.target);
    } else {
        show();
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) SuppressLint(android.annotation.SuppressLint) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)186 Animator (android.animation.Animator)62 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)54 View (android.view.View)52 ObjectAnimator (android.animation.ObjectAnimator)41 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40 ImageView (android.widget.ImageView)26 AnimatorSet (android.animation.AnimatorSet)24 TextView (android.widget.TextView)23 Animation (android.view.animation.Animation)21 ValueAnimator (android.animation.ValueAnimator)17 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)14 OvershootInterpolator (android.view.animation.OvershootInterpolator)13 Point (android.graphics.Point)12 Paint (android.graphics.Paint)10 Interpolator (android.view.animation.Interpolator)9 AlphaAnimation (android.view.animation.AlphaAnimation)8 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)8