MathRoda / Snackie

a Custom Snackbar Library for Jetpack Compose πŸš€πŸŽ¨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

banner

🎨 Snackie is a custom snackbar library for jetpack compose built without using the built in snackbar component

πŸ“š 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.

About

a Custom Snackbar Library for Jetpack Compose πŸš€πŸŽ¨

License:Apache License 2.0


Languages

Language:Kotlin 100.0%