To make you app more modern, you can include transition animations between activities. There are different ways this can be done and in this piece we want to examine them.
(a). Use Intent Animation Library
This library is as easy as it gets. You can easily include different type of animations in your activities.
Step 1: Installation
Start by install the library. It is hosted in jitpack:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then add the implementation statement as a dependency:
implementation 'com.github.hajiyevelnur92:intentanimation:1.0'
Step 2: Code
Here is the code:
import static maes.tech.intentanim.CustomIntent.customType;
//MainActivity or any activity name
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//.....//
//here is library
customType(MainActivity.this,"here is animation name");
}
//Here are the animations
*left-to-right
*right-to-left
*bottom-to-up
*up-to-bottom
*fadein-to-fadeout
*rotateout-to-rotatein
Links
Download the full code here.