- Notifications
You must be signed in to change notification settings - Fork0
Show a dialog with 'Don't show again' option to remember the preference, with just 1 line of code.
License
NotificationsYou must be signed in to change notification settings
tashilapathum/NeverAgain
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 yoursettings.gradle.kts
:
dependencyResolutionManagement { repositories { maven("https://jitpack.io") }}
Then, add the dependency to your module-levelbuild.gradle.kts
:
dependencies { implementation("com.github.tashilapathum:NeverAgain:latest-version")}
Replacelatest-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")
privateval 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
About
Show a dialog with 'Don't show again' option to remember the preference, with just 1 line of code.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published