- Add this to
build.gradle
ofproject
gradle dependency
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add this to
build.gradle
ofapp
gradle dependency
dependencies {
implementation 'com.github.gayankuruppu:android-layout-transitions-kotlin:1.0.1'
}
- Add this to
build.gradle
ofproject
gradle dependency
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add this to
build.gradle
ofmodule
gradle dependency
<dependency>
<groupId>com.github.gayankuruppu</groupId>
<artifactId>android-layout-transitions-kotlin</artifactId>
<version>1.0.1</version>
</dependency>
import layout.transitions.library.*
import layout.transitions.library.*;
// declare TextView
val intent = Intent(this, LoadActivity::class.java)
val buttonView: Button = findViewById(R.id.buttonView)
// go to view
buttonView.setOnClickListener {
// start intent
startActivity(intent)
// set transition
val transitions = Transitions(this@MainActivity)
transitions.setAnimation(Slide().InRight())
}
// declare variables
Intent myIntent = new Intent(CurrentActivity.this, NextActivity.class);
Button buttonView = (Button) findViewById(R.id.buttonView);
// go to view
buttonView.setOnClickListener( new OnClickListener() {
@Override
public void onClick(View v) {
// start intent
startActivity(intent);
// set transition
Transitions transitions = Transitions(MainActivity.this);
transitions.setAnimation(Slide().InRight());
}
});
To animate the layout, create Transitions class and set the method name and specific transition method name to setAnimation
method.
The following classes are the transitions support by the library
Class Name | ||||
---|---|---|---|---|
Slide |
Fade |
Flip |
Rotate |
Zoom |
Slide |
|||
---|---|---|---|
InLeft |
InRight |
||
InUp |
InDown |
Fade |
|||
---|---|---|---|
InLeft |
InRight |
||
InUp |
InDown |
||
In |
Flip |
|
---|---|
InLeft |
Flip |
|
---|---|
InLeft |
Flip |
|
---|---|
InLeft |
- Select
Git
fromCheck out project from Version Control
in your Android Studio - Paste the repository url and click
Clone
button - Click
Yes
to open the repository Build
using the latestGradle
version
Go to https://github.com/gayankuruppu/android-vpn-client-ics-openvpn#develop see the steps