A lightweight Android library to show beautiful, customizable Material dialogs with minimal setup.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.sonpxp:material-dialog-os:$version'
}🔔 Replace
$versionwith the latest version from JitPack.
You can show a simple Yes/No confirmation dialog like this:
AlertMaterialHelper.showYesNoAlert(
context = this,
title = "Hello",
message = "Do you want to continue?",
onAgreeCallback = onAgreeCallback,
onCancelCallback = onCancelCallback
)
private val onAgreeCallback: () -> Unit = {
// Handle agree action
}
private val onCancelCallback: () -> Unit = {
// Handle cancel action
}// Example method
AlertMaterialHelper.name_method()Replace
name_method()with the actual method name provided by the library.
Your app must use a MaterialComponents theme to avoid unexpected errors.
Example:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>✅ Make sure your theme extends
Theme.MaterialComponents.*.
This library is released under the MIT License.
Developed and maintained by @sonpxp. Contributions and feedback are welcome!