This is a simple util to create Activity transition animation

Overview

TransitionHelper

This is a simple util to create Activity transition animation

API compatible with Android 2.2+

中文说明

Screenshots

How to use

1.startActivity

TransitionsHeleper.startActivity(this, ImageDetailActivity.class, view, load);

2. in target Activity

    TransitionsHeleper.build(this)
                .setShowMethod(new ColorShowMethod(R.color.bg_teal_light, R.color.bg_purple) {
                    @Override
                    public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
                        Glide.with(ImageDetailActivity.this)
                                .load(bean.getLoad())
                                .centerCrop()
                                .into(placeholder);
                    }

                    @Override
                    public void loadTargetView(InfoBean bean, View targetView) {
                        Glide.with(ImageDetailActivity.this)
                                .load(bean.getLoad())
                                .centerCrop()
                                .into((ImageView) targetView);
                        tv.setText("immortalz");
                    }
                })
                .setExposeColor(getResources().getColor(R.color.bg_purple))
                .intoTargetView(ivDetail)
                .show();

3. unbind this

    @Override
    protected void onDestroy() {
        TransitionsHeleper.unbind(this);
        super.onDestroy();
    }

API

name description
setExposeView CirleExposeView,FoldExposeView(you can custom others by extends ExposeView)
setExposeColor if not set , will be transparent color
setExposeAcceleration must > 0 ,default 7
setShowMethod NoneShowMethod(Default),ColorShowMethod,InflateShowMethod(you can custom others by extends ShowMethod)
intoTargetView
setTransitionDuration
setTransitionListener

Quick start

Gradle

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

Maven

<dependency>
  <groupId>me.immortalz</groupId>
  <artifactId>transitionhelper</artifactId>
  <version>2.3.0</version>
  <type>pom</type>
</dependency>

TODO

  • To better support imageview

  • Add Back animation

  • Add Animation Listener

Update record

v2.3

  • remove TransitionsHeleper.onPause (add TransitionsHeleper.unbind)
  • Add setExposeAcceleration

v2.2

  • Repair because of the constant clicks leading to OOM
  • Add more listener

v2.1

  • Repair caused memory leaks because of misuse
  • Add more Animation

End

Welcome to perfect this library .

Contact

WeChat

这里写图片描述

WeiBo:

http://weibo.com/u/1956502961

License

Copyright (c) 2017 ImmortalZ

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • 是版本问题还是啥的 代码中的动画不对 起始点都在0,0

    是版本问题还是啥的 代码中的动画不对 起始点都在0,0

    ObjectAnimator.ofFloat(child, "translationX", 0, -bean.translationX) 这句代码是从 X = 0 -> X = -bean.translationX 横向的平移

    我是设置 ivTemp 的setX setY 然后 ObjectAnimator.ofFloat(child, "translationX", child.getX(), bean.translationX),

    opened by jsbsdbd1025 4
  • 效果不错,就是不够实用

    效果不错,就是不够实用

    提出1点不足和1点建议: 不足:不够实用,页面跳转往往需要用intent携带数据进行传递,你干脆没这个参数,你让大伙怎么用你的库?建议赶紧改进. 建议:既然涉及到了携带数据进行页面跳转,那么应该添加动画相关的监听,比如从A界面进入B界面,如果动画还没加载完就进行请求数据操作,或者数据还没加载出来,动画就已经结束了,这样展现的效果都不好,给个动画监听,比如动画开始加载,动画加载中,动画加载完毕等监听或回调,让大伙可以根据你的各个回调做相应的操作,这样数据的展现与动画的执行就有了很好的协调性.

    opened by qiangxi 3
  • 点击太快

    点击太快

    java.lang.NullPointerException at immortalz.me.library.TransitionsHeleper$3.run(TransitionsHeleper.java:222) at android.os.Handler.handleCallback(Handler.java:808) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5299) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641) at dalvik.system.NativeStart.main(Native Method)

    opened by 4what2do 1
  • BaseActivity中的@Nullable注解问题

    BaseActivity中的@Nullable注解问题

    public abstract class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
    

    请教一下,为什么要添加为空注解?

    opened by HXQWill 1
  • 想实现FAB扩散进入新的Activity的效果

    想实现FAB扩散进入新的Activity的效果

    如题。但是调用TransitionsHeleper.startActivity(actitivy.this,class,fab)这个方法会有错误,显示cannot resovle this method. 调用TransitionsHeleper.startActivity(actitivy,intent,,fab)又没有那个效果。请指教。

    opened by drogbababa 1
  • 缩放设置的宽高参数写反了;获取的view尺寸有误

    缩放设置的宽高参数写反了;获取的view尺寸有误

    1. 缩放设置的宽高参数写反了

    2. 如果view部分位于屏幕外,getGlobalVisibleRect 获取的尺寸不是理想值,可以改为:

    int out[] = new int[2];
    view.getLocationOnScreen(out);
    return new Rect(out[0], out[1], out[0] + view.getWidth(), out[1] + view.getHeight());
    
    opened by TomeOkin 1
  • BaseActivity @Nullable

    BaseActivity @Nullable

    public abstract class BaseActivity extends AppCompatActivity {
    
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
    

    Why add the @Nullable in this?

    opened by HXQWill 0
Owner
ImmortalZ
念念不忘,必有回响 有一口气,点一盏灯
ImmortalZ
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.

PreLollipopTransition Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices. Download In your app build.gr

Takahiro Menju 1.3k Nov 28, 2022
ArcAnimator helps to create arc transition animation: 2.3.+

ArcAnimator ArcAnimator helps to create arc transition animation: 14+ | ArcAnimator Demo | TransitionLoop Demo* *TransitionLoop Prototype by Min-Sang

Asyl Isakov 1.2k Dec 20, 2022
Lightweight Android library for cool activity transition animations

Bungee min SDK 16 (Android Jellybean 4.1) written in Java A lightweight, easy-to-use Android library that provides awesome activity transition animati

Dean Spencer 172 Nov 18, 2022
3D animation examples for support-v4 Fragment transition.

FragmentAnimations Animation examples for support.v4.Fragment transition. These animations do not depends on any external libraries. Usage Example In

Keita Kajiwara 1.1k Dec 14, 2022
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

Orbitary ?? Jetpack Compose animation library that allows you to implement animations such as shared element transition. Download Gradle Add the depen

Jaewoong Eum 503 Dec 30, 2022
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

?? Jetpack Compose animation library that allows you to implement animations such as shared element transition.

Jaewoong Eum 504 Jan 2, 2023
Wave effect of activity animation

WaveCompat Wave effect of activity animation How to use 1. Bind wave touch helper to a view which will start an activity when it clicked: WaveTouchHel

WangJie 348 Nov 29, 2022
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Android Transition animations explanation with examples.

UNMAINTAINED No maintainance is intended. The content is still valid as a reference but it won't contain the latest new stuff Android Transition Frame

Luis G. Valle 13.6k Dec 28, 2022
Android Animation Easing Functions. Let's make animation more real!

Android Easing Functions This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make

代码家 2.5k Jan 4, 2023
DuGuang 1k Dec 14, 2022
Android ripple animation helper, easy to create Circular Reveal. | Android水波动画帮助类,轻松实现View show/hide/startActivity()特效。(0.4.6)

CircularAnim English | 中文 首先来看一个UI动效图。 效果图是是Dribbble上看到的,原作品在此。 我所实现的效果如下: Watch on YouTube Compile 最新可用版本 So,你可以如下compile该项目,也可以直接把这个类 CircularAnim 拷

ice 2k Nov 19, 2022
create your custom themes and change them dynamically with ripple animation

Android Animated Theme Manager create your custom themes and change them dynamically with ripple animation Features support java and kotlin projects.

Iman Dolatkia 601 Dec 22, 2022
Android Library to create Lottie animation view dialog easily with a lot of customization

LottieDialog Android Library to create Lottie animation view dialog easily with a lot of customization Why you should use Lottie Dialog You have no li

Amr Hesham 39 Oct 7, 2022
Android Library to create Lottie animation view dialog easily with a lot of customization

Android Library to create Lottie animation view dialog easily with a lot of customization

Amr Hesham 39 Oct 7, 2022
🌠 Transform into a different view or activity using morphing animations.

TransformationLayout ?? Transform into a different view or activity using morphing animations. Using Transformation motions of new material version. D

Jaewoong Eum 2k Jan 3, 2023
Easily add slide to dismiss functionality to an Activity

Slidr Easily add slide-to-dismiss functionality to your Activity by calling Slidr.attach(this) in your onCreate(..) method. Usage An example usage: pu

Drew Heavner 2.7k Jan 6, 2023