https://github.com/futuremind/android-animation-dsl
https://github.com/futuremind/android-animation-dsl
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/futuremind/android-animation-dsl
- Owner: FutureMind
- License: mit
- Created: 2018-10-17T10:03:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-23T10:06:41.000Z (almost 7 years ago)
- Last Synced: 2025-03-27T12:46:28.876Z (over 1 year ago)
- Language: Kotlin
- Size: 138 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Animators DSL
Small yet very useful set of Kotlin extension functions to build Android animations more easy and straightforward.
## Usage:
```kotlin
playSequentially {
onAnimationEnd { /* Animation finished */) }
play { /* Animator object */ }
play { ObjectAnimator.ofFloat(view1, View.ALPHA, 0f, 1f) }
play { view1 translateTo container.topLeft() }
play { view2 translateTo container.bottomLeft() }
playTogether {
startDelay = 2000L
duration = 1000L
interpolator = FastOutSlowInInterpolator()
play { view1 translateTo container.topRight() }
play { view2 translateTo container.bottomRight() }
}
playTogether {
onAnimationStart { /* Animation started */ }
play { view1 translateTo container.center() withDuration 2000 withInterpolator OvershootInterpolator() }
play { view2 translateTo container.center() withDuration 2000 withInterpolator AccelerateDecelerateInterpolator() }
}
}.start()
```
## Installation:
Add it in your root build.gradle at the end of repositories:
```groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency:
```groovy
dependencies {
implementation 'com.github.FutureMind:android-animation-dsl:1.0'
}
```