您当前的位置: 首页 > 

TransitionHelper

发布时间:2016-11-02 09:16:02 ,浏览量:0

TransitionHelper
项目地址: ImmortalZ/TransitionHelper
简介:This is a simple util to create Activity transition animation

This is a simple util to create Activity transition animation

API compatible with Android 2.2+

中文说明

Screenshots

   

Simple example

This is just a part of the usage,more usage,please to see demo.

With Intent
Intent intent = new Intent(this, IntentDetailActivity.class);
        intent.putExtra(IntentDetailActivity.TRANSITION_DATA, "This is immortalZ");
        TransitionsHeleper.startActivity(this, intent, btn);

target Activity

Intent intent = getIntent();
        if (intent != null) {
            tv.setText(intent.getStringExtra(TRANSITION_DATA));
        }
        TransitionsHeleper.getInstance()
                .show(this, null);
With layout which you can add Customized
TransitionsHeleper.startAcitivty((Activity) mContext, RvDetailActivity.class,
                        holder.itemView.findViewById(R.id.iv1),
                        imageUrl);

target Activity

TransitionsHeleper.getInstance()
                .setShowMethod(new InflateShowMethod(this, R.layout.activity_rv_inflate) {
                    @Override
                    public void loadCopyView(InfoBean bean, ImageView copyView) {
                        Glide.with(RvDetailActivity.this)
                                .load(bean.getImgUrl())
                                .fitCenter()
                                .into(copyView);
                    }

                    @Override
                    public void loadTargetView(InfoBean bean, ImageView targetView) {
                        Glide.with(RvDetailActivity.this)
                                .load(bean.getImgUrl())
                                .fitCenter()
                                .into((ImageView) targetView);
                    }
                })
                .show(this, ivDetail);
With Image
TransitionsHeleper.startAcitivty(this, ImageDetailActivity.class, iv1, imgUrl);

target Activity

TransitionsHeleper.getInstance()
                .setShowMethod(new ColorShowMethod(R.color.bg_teal_light,
                        R.color.bg_purple) {
                    @Override
                    public void loadCopyView(InfoBean bean, ImageView copyView) {
                        Glide.with(ImageDetailActivity.this)
                                .load(bean.getImgUrl())
                                .centerCrop()
                                .into(copyView);
                    }

                    @Override
                    public void loadTargetView(InfoBean bean, ImageView targetView) {
                        Glide.with(ImageDetailActivity.this)
                                .load(bean.getImgUrl())
                                .centerCrop()
                                .into(targetView);
                    }

                }).show(this, ivDetail);
With Other View ,such as FloatingActionButton
TransitionsHeleper.startAcitivty(FabActivity.this, FabCircleActivity.class, btnCircle);

target Activity

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);
Quick start

Gradle

dependencies {
   compile 'me.immortalz:transitionhelper:1.0.5'
}

Maven

me.immortalztransitionhelper1.0.5pom
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    111043博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0497s