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.

GitHub

View Github