https://github.com/mejdi14/vanish-composable
Delete a composable with animation (make it vanish)
https://github.com/mejdi14/vanish-composable
android animations compose-animations jetpack-compose kotlin pixel-effect vanish-composable
Last synced: 6 months ago
JSON representation
Delete a composable with animation (make it vanish)
- Host: GitHub
- URL: https://github.com/mejdi14/vanish-composable
- Owner: mejdi14
- Created: 2025-01-07T20:19:48.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-15T10:32:19.000Z (9 months ago)
- Last Synced: 2025-03-28T22:33:27.581Z (7 months ago)
- Topics: android, animations, compose-animations, jetpack-compose, kotlin, pixel-effect, vanish-composable
- Language: Kotlin
- Homepage:
- Size: 9.77 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Welcome to Vanish Composable Library 👋
## ✨ Demo
![]()
![]()
## :art:Design inspiration
many thanks goes to [A. Hassan](https://x.com/azhassan_) for the beautiful design and
animation## Installation
Add this to your module's `build.gradle` file (make sure the version matches the JitPack badge
above):```gradle
dependencies {
...
implementation("io.github.mejdi14:vanish_composable:0.0.2")
}
```## :fire:How to use
``` java
var controller: AnimationController? by remember { mutableStateOf(null) }
VanishComposable(
Modifier,
VanishOptions = VanishOptions(),
effect = AnimationEffect.SHATTER,
onControllerReady = {
controller = it
}
) {
// Your Composable
ContentComposable()
}
```Animation Listener
-----``` java
// Start animation
controller?.triggerVanish() {
// Do something when animation finishes
}
// Reverse animation
controller?.reset()
```Animation types
-----``` java
PIXELATE,
SWIRL,
SCATTER,
SHATTER,
WAVE,
LEFT_TO_RIGHT,
RIGHT_TO_LEFT,
UP,
DOWN,
DISSOLVE,
EXPLODE
```Hold animation duration after separation
-----``` java
.timeBetweenAnimations
```Configuration options
-----``` java
pixelSize: size of each pixel or dot
pixelSpacing: space between pixels when they are separated
pixelVelocity: velocity of the pixels
animationDuration: duration of the animation from start to finish
triggerFinishAt: use this if you want to trigger the end of animation a bit earlier (1f: wait to end, 0f: don't wait)
```## 🤝 Contributing
Contributions, issues and feature requests are welcome.
Feel free to check [issues page] if you want to contribute.## Author
👤 **Mejdi Hafiane**
- profile: [@MejdiHafiane](https://twitter.com/mejdi141)
## Show your support
Please ⭐️ this repository if this project helped you!
## 📝 License
Copyright © 2019 [Mejdi Hafiane](https://github.com/mejdi14).
This project is [MIT](https://github.com/mejdi14/readme-md-generator/blob/master/LICENSE) licensed.