Flashbar
Library to display awesome Flashbar
Install / Use
/learn @hasanelfalakiy/FlashbarREADME
Read in Indonesia
About Flashbar
Library for displaying messages as an alternative to snackbars and toast, which is powerful, easy to customize, and easy to use. Based on Flashbar (AndroidIDE) that based on Flashbar (aritraroy)
Configuration
- Put this code in settings.gradle.kts (root kotlin dsl) in
repositoriesblock
dependencyResolutionManagement {
repositories {
// example
maven {
url = uri("https://jitpack.io")
}
}
}
If using groovy dsl
repositories {
maven { url 'https://jitpack.io' }
}
- Put dependencies into build.gradle.kts (app/build.gradle.kts kotlin dsl)
inside the
dependenciesblock
implementation("com.github.hasanelfalakiy:flashbar:${version}")
if using groovy dsl
implementation 'com.github.hasanelfalakiy:flashbar:${version}'
Read Dokka Documentation
Usage
1. Basic Usage (Activity/View)
Flashbar.Builder(this)
.gravity(Flashbar.Gravity.TOP) // or BOTTOM
.title("Hello World!")
.message("This is a message from Flashbar.")
.backgroundColorRes(R.color.colorPrimary)
.build()
.show()
2. Usage in Jetpack Compose
In Jetpack Compose, you can use LocalContext to get the Activity.
@Composable
fun MyScreen() {
val context = LocalContext.current
val activity = context as Activity
Button(onClick = {
Flashbar.Builder(activity)
.message("Appears in Jetpack Compose!")
.build()
.show()
}) {
Text("Show Flashbar")
}
}
3. Card Customization (New!)
You can now customize the appearance of Flashbar cards to be more flexible.
Flashbar.Builder(activity)
.message("Custom Flashbar")
// Set the elevation (shadow). Use 0f so there are no shadows
.cardElevation(0f)
// Set the corner radius. Use 0f for perfect square corners
.cardCornerRadius(0f)
.build()
.show()
Want to contribute?
If you want to contribute, please fork this repository, clone to your local machine, make changes, push, and then send a pull request to this repository
Contact us
License
Copyright 2016 aritraroy
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.
flashbar
Copyright (C) 2024 Akash Yadav (AndroidIDE)
... (License details are the same as before)
flashbar
Copyright (C) 2026 Andi Hasan Ashari
... (License details are the same as before)
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
