A simple dialog with a 'Don't show again' option to remember the preference.
Customized dialog | With default labels | Dark mode |
---|---|---|
![]() |
![]() |
![]() |
- Stores the preference based on the hash value of the passed message
- Simply updating the message will show the dialog again with the new information
- Can reset a specific dialog or all dialogs
- Supports the latest Material 3 design
- Follows Dark and Light modes automatically
- Lightweight and Easy to implement
Add JitPack to your settings.gradle.kts
:
dependencyResolutionManagement {
repositories {
maven("https://jitpack.io")
}
}
Then, add the dependency to your module-level build.gradle.kts
:
dependencies {
implementation("com.github.tashilapathum:NeverAgain:latest-version")
}
Replace latest-version
with the latest release at the top of this file.
NeverAgainDialog
.create("Tip", "This is a helpful tip!")
.show(supportFragmentManager, "NeverAgainDialog")
NeverAgainDialog.create(
title = "Enable Notifications",
message = "Please allow notification permission to receive latest updates.",
positiveButtonText = "OK",
checkboxText = "Never show again",
isChecked = false,
).setOnDismissedListener { isChecked ->
if (isChecked) {
// Handle user preference
}
}.show(supportFragmentManager, "NeverAgainDialog")
private val tip1 = "This is a helpful tip."
NeverAgainDialog.create("Tip", tip1).show(supportFragmentManager, "NeverAgainDialog")
NeverAgainDialog().clear(context, tip1)
Clears a specific dialog preference
NeverAgainDialog.create("Tip", tip1).show(supportFragmentManager, "NeverAgainDialog")
NeverAgainDialog().clearAll(context)
Clears all dialog preferences