https://github.com/mejdi14/blob-stepper
Jetpack Compose Stepper library
https://github.com/mejdi14/blob-stepper
android animation jetpack-compose kotlin library step stepper
Last synced: 7 months ago
JSON representation
Jetpack Compose Stepper library
- Host: GitHub
- URL: https://github.com/mejdi14/blob-stepper
- Owner: mejdi14
- Created: 2024-03-22T11:09:32.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-29T23:10:04.000Z (over 1 year ago)
- Last Synced: 2025-01-11T03:27:45.831Z (9 months ago)
- Topics: android, animation, jetpack-compose, kotlin, library, step, stepper
- Language: Kotlin
- Homepage:
- Size: 10.1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Welcome to Card Switcher Library 👋
## ✨ Demo
![]()
## Installation
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
```gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
## :hammer:DependencyAdd this to your module's `build.gradle` file (make sure the version matches the JitPack badge above):
```gradle
dependencies {
...
implementation 'com.github.mejdi14:blob-stepper:0.0.1'
}
```## :fire:How to use
``` java
val controller = remember { BlobProgressController(steps = 3) }
BlobStepper(controller = controller,
blobCircle = BlobCircle(
blobContent = BlobContent.TextContent(text = textValue)
),
blobActionListener = object : BlobActionListener() {
override fun onChangeListener(step: Int) {
}override fun onFinishListener() {
}override fun onExplodeListener() {
}
})
```Blob Cicrle Options
-----``` java
radius: Initial circle radius
shrinkRadius: Circle radius after transformation
color: Color = Cicle color
wavesHeight: Blob waves height
wavesMovementDurationMillis: Blob waves animation duration
sizeTransformationDurationMillis: Circle state change duration
wavesCount: Number of waves
blobContent: Blob content (Text or Image)
```
Progress Circle Options
-----``` java
radius : Initial progress circle radius
strokeWidth: Border stroke width
strokeDefaultColor: Stroke background color
strokeFilledColor: Stroke progress color
startAngle: At which angle the progress animation starts
progressAnimationDurationMillis: Progress animation duration
```Controller Functions
-----``` java
progress: State : Progress percent
currentStep: State : Current Step
isExpanded: State : Cicle is on initial size
isExploded: State : Circle covers all the screen
isFinished: State : Progress circle reached final step
stepsCount: Int : All steps count
completionListener: ProgressCompletionListener : Progress is over
shrink() : Transform the circle to the smaller size and start blob waves animation
expand() : Go back to the initial circle size and cancel animation
explode() : Cover all screen
next() : Go to the next step progress
back() : Go back to the previous step
goTo(step: Int) : Go to a specific step
reset() : Rest the progress counter
```Actions Listener
-----``` java
onStartListener() : Animation started (circle shrink and blob waves are moving)onChangeListener(step: Int) : Triggered when there is a change in the circle state
onNextStepListener() : Triggered when we move to a new step
onFinishListener() : We reached the final step
onClickListener() : On Circle click listener
onExplodeListener() : Circle is exploded and covered all the screen
```
Blob Content
-----
``` java
BlobContent.TextContent(text = textValue)BlobContent.ImageContent(painter = painterValue)
```
insde the Blob Circle you can put a Text Composable or an Image Composable,
both accept State value so that you can change the content value while you navigate from a step to another.## 🤝 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.