A light transition lib(with only 2 files...) for Android, scince shared elements transition is not supported before LOLLIPOP, using EasyTransition can easily make fun transition animation between elements in two activities. Enjoy it!
Add to your root build.gradle:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
dependencies {
compile 'com.github.huzenan:EasyTransition:v1.0.0'
}
<!-- Activity A -->
<ImageView
android:id="@+id/iv_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@mipmap/avatar_male"
/>
<!-- Activity B -->
<ImageView
android:id="@+id/iv_icon"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@mipmap/avatar_male"
/>
// ready for transition options
EasyTransitionOptions options =
EasyTransitionOptions.makeTransitionOptions(
ActivityA.this,
findViewById(R.id.iv_icon),
findViewById(R.id.tv_name)); // add as many views as you like
// start transition
Intent intent = new Intent(ActivityA.this, ActivityB.class);
EasyTransition.startActivity(intent, options);
// onCreate
EasyTransition.enter(ActivityB.this);
// onBackPressed
EasyTransition.exit(ActivityB.this);
Usage above is only the minimum choice, you can set attributes like duration, time interpolator and so on, have fun!