BradPatras / keyboard-visibility-event-android

A DSL to handle soft keyboard visibility change event written in Kotlin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License

About

A DSL to handle soft keyboard visibility change event written in Kotlin. This fork was created to fix a null pointer exception crash due to an incorrect override function signature.

How to use?

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.BradPatras:keyboard-visibility-event-android:1.0.10'
}

Step 3. Code example

Use the keyboard extension function available on Activity and Fragment

keyboard {
    onClosed { Toast.makeText(this@MainActivity, "onClosed", Toast.LENGTH_SHORT).show() }
    onOpened { Toast.makeText(this@MainActivity, "onOpened", Toast.LENGTH_SHORT).show() }
}

Demo

  Special thanks

@viniciusmo
@yshrsmz
@amadeu01
@J-Jamet

About

A DSL to handle soft keyboard visibility change event written in Kotlin.


Languages

Language:Kotlin 100.0%