Search in sources :

Example 1 with ColorShowMethod

use of immortalz.me.library.method.ColorShowMethod 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 2 with ColorShowMethod

use of immortalz.me.library.method.ColorShowMethod 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 3 with ColorShowMethod

use of immortalz.me.library.method.ColorShowMethod in project TransitionHelper by ImmortalZ.

the class FDetailActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportFragmentManager().beginTransaction().replace(R.id.container, DetailFragment.newInstance()).commit();
    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)

Aggregations

AnimatorSet (android.animation.AnimatorSet)3 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)3 ImageView (android.widget.ImageView)3 InfoBean (immortalz.me.library.bean.InfoBean)3 ColorShowMethod (immortalz.me.library.method.ColorShowMethod)3