Step 1: Add this your root settings.gradle.kts
dependencyResolutionManagement {
maven("https://jitpack.io")
}
Step 2: Add this your app build.gradle.kts
dependencies {
implementation("com.github.pisalcoding:alerter:v1.0.0-alpha")
}
Step 1: Add this your root build.gradle
repositories {
maven { url "https://jitpack.io" }
}
Step 2: Add this your app build.gradle
dependencies {
implementation 'com.github.pisalcoding:alerter:v1.0.0-alpha'
}
Call the library from your activity or fragment
Alerter.success()
.withTitle("Success")
.withMessage("Congratulations!")
.show(supportFragmentManager, "Tag")
Alerter.info()
.withTitle("Tips")
.withMessage("Look away from your screens every 20 minutes.")
.setIconDrawable(
ResourcesCompat.getDrawable(resources, drawable.round_check_circle_24, theme)
)
.setTimeoutMillis(4000)
.setOnDismissListener {
// Do something after dialog is dismissed
}
.show(supportFragmentManager, "Tag")