Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huzenan/EasyTransition
A light Shared Elements Transition lib for Android.
https://github.com/huzenan/EasyTransition
Last synced: 3 months ago
JSON representation
A light Shared Elements Transition lib for Android.
- Host: GitHub
- URL: https://github.com/huzenan/EasyTransition
- Owner: huzenan
- License: apache-2.0
- Created: 2017-05-09T09:19:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-04T06:46:13.000Z (almost 7 years ago)
- Last Synced: 2024-06-16T06:38:20.905Z (5 months ago)
- Language: Java
- Homepage:
- Size: 938 KB
- Stars: 392
- Watchers: 6
- Forks: 52
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - EasyTransition - 一个轻量级的共享元素迁移库 (其他)
README
# EasyTransition
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!## ScreenShots
![easytransition](https://github.com/huzenan/EasyTransition/blob/master/screenshots/easy%20transition.gif)## Usage
### 1.Add the library.
Add to your root build.gradle:
```xml
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Add the dependency:
```xml
dependencies {
compile 'com.github.huzenan:EasyTransition:v1.0.0'
}
```### 2.Using same ids between two Views in two layouts.
```xml
```### 3.In Activity A, make transition options, and start Activity B with EasyTransition#startActivity.
```java
// 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);
```### 4.In Activity B, enter transition when creating, and exit transition when backing.
```java
// onCreate
EasyTransition.enter(ActivityB.this);
// onBackPressed
EasyTransition.exit(ActivityB.this);
```## Attributes
Usage above is only the minimum choice, you can set attributes like duration, time interpolator and so on, have fun!