Skip to content

pisalcoding/alerter

Repository files navigation

Alerter for Android

Get Started with Gradle’s Kotlin DSL

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

OR Get Started with Legacy Gradle

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'
}

Usage

Simple

Call the library from your activity or fragment

Alerter.success()
    .withTitle("Success")
    .withMessage("Congratulations!")
    .show(supportFragmentManager, "Tag")

With some customization

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

About

A simple Android top alert dialog.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages