π
Implementation
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.mathroda:Snackie:latest-version'
}
π
How to use it ?
β
Snackie Success
Column( modifier = Modifier.fillMaxSize()) {
val state = rememberSnackieState()
Button(onClick = { state.addMessage("This is a Success Message!") }) {
Text(text = "Success")
}
SnackieSuccess(state = state)
}
β
Snackie Error Column( modifier = Modifier.fillMaxSize()) {
val state = rememberSnackieState()
Button(onClick = { state.addMessage("This is a Error Message!") }) {
Text(text = "Error")
}
SnackieError(state = state)
}
π
Snackie Custom 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.
License
Designed and developed by 2022 Mathroda (Mouawia Hammo)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.