An open API service indexing awesome lists of open source software.

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)

Awesome Lists containing this project

README

          

Welcome to Vanish Composable Library 👋



gitmoji-changelog

gitmoji-changelog



License: MIT




## ✨ 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.