karthikkompelli / PeekAlert

A Lightweight and Highly-customizable alert library for Android, usable in both Java and Kotlin.

Home Page:https://profile.mooner.dev/PeekAlert/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


PeekAlert

A Lightweight and Highly-customizable alert library

PeekAlert can be used on both Java and Kotlin.
See the examples below for more info.

✔ Any PRs are welcome!

Demo

Installation (Gradle)

  • Add jitpack url

Kotlin DSL:

repositories {
    /* ... */
    maven(url = "https://jitpack.io")
}

Groovy DSL:

repositories {
    /* ... */
    maven { url 'https://jitpack.io' }
}
  • Add PeekAlert dependency
dependencies {
    implementation("com.github.mooner1022:PeekAlert:<VERSION>")
}

Usage

Basic usages

Java

PeekAlert peekAlert = PeekAlert.create(this)
                .setDraggable(true)
                .setTitle("Hello, PeekAlert!")
                .setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");

peekAlert.peek();

Kotlin

val peekAlert = PeekAlert.create(this)
            .setDraggable(true)
            .setTitle("Hello, PeekAlert!")
            .setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")

peekAlert.peek()

Builder for kotlin is also available:

createPeekAlert(this) {
    draggable = true
    title("Hello, PeekAlert Builder!") {
        textColor(res = R.color.black)
    }
    text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") {
        textSize = 14f
    }
}.peek()

Custom

To be documented...

Get more info at docs

Dokka Docs

About

A Lightweight and Highly-customizable alert library for Android, usable in both Java and Kotlin.

https://profile.mooner.dev/PeekAlert/


Languages

Language:Kotlin 98.6%Language:Java 1.4%