Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

Repository files navigation

A simple dialog with a 'Don't show again' option to remember the preference.

Preview

Customized dialogWith default labelsDark mode
Screenshot_20250212_213951Screenshot_20250212_214028Screenshot_20250212_214135

Features

  • 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

Installation

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.

Usage

Minimal example

NeverAgainDialog    .create("Tip","This is a helpful tip!")    .show(supportFragmentManager,"NeverAgainDialog")

Full example

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")

Clear preferences

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

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp