-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
![banner](https://user-images.githubusercontent.com/92212925/205930069-886166b7-4c33-47bc-a498-1e82596d0cdd.png)<br> | ||
<p align="center"> | ||
π¨ Snackie is a custom snackbar library for jetpack compose built without using the built in snackbar component | ||
</p> | ||
|
||
|
||
## π Implementation | ||
```gradle | ||
repositories { | ||
maven { url 'https://jitpack.io' } | ||
} | ||
dependencies { | ||
implementation 'com.github.mathroda:Snackie:latest-version' | ||
} | ||
``` | ||
|
||
|
||
## π How to use it ? | ||
|
||
|
||
### Snackie Success β | ||
|
||
<img src="https://user-images.githubusercontent.com/92212925/205937500-36dfaa43-8038-4400-ba31-02691b4e6050.gif" align="right" width="25%" /> | ||
|
||
```kotlin | ||
Column( modifier = Modifier.fillMaxSize()) { | ||
|
||
val state = rememberSnackieState() | ||
|
||
Button(onClick = { state.addMessage("This is a Success Message!") }) { | ||
Text(text = "Success") | ||
} | ||
|
||
SnackieSuccess(state = state) | ||
} | ||
``` | ||
|
||
### Snackie Error β | ||
```kotlin | ||
Column( modifier = Modifier.fillMaxSize()) { | ||
|
||
val state = rememberSnackieState() | ||
|
||
Button(onClick = { state.addMessage("This is a Error Message!") }) { | ||
Text(text = "Error") | ||
} | ||
|
||
SnackieError(state = state) | ||
} | ||
``` | ||
|
||
### Snackie Custom π | ||
```kotlin | ||
Column( modifier = Modifier.fillMaxSize()) { | ||
|
||
val state = rememberSnackieState() | ||
|
||
Button(onClick = { state.addMessage("This is a Custom Message!") }) { | ||
Text(text = "Custom") | ||
} | ||
|
||
SnackieCustom( | ||
state = state, | ||
position = SnackiePosition.Float, | ||
duration = 3000L, | ||
icon = Icons.Default.Star, | ||
containerColor = Color.Gray, | ||
contentColor = Color.White, | ||
enterAnimation = fadeIn(), | ||
exitAnimation = fadeOut(), | ||
verticalPadding = 12.dp, | ||
horizontalPadding = 12.dp | ||
) | ||
} | ||
``` | ||
|
||
# π Contribution | ||
|
||
Please feel free to contribute! | ||
|
||
If this will be your first contributon, you can check this [website.](https://opensource.guide/how-to-contribute/) | ||
|