/ Keyboard

TedKeyboardObserver is keyboard's visibility observer

TedKeyboardObserver is keyboard's visibility observer

TedKeyboardObserver

TedKeyboardObserver is keyboard's visibility observer.

  • Sometime we want to know keyboard's visibility. (When keyboard shown, change some layout or do something. etc..)
  • But Android SDK doesn't have any observer.
  • TedKeyboardObserver provide keyboard visibility

Demo

  • You can observe keyboard status like this

TedKeyboardObserver

  • Keyboard show / hide

TedKeyboardObserver

Setup

Gradle

Download

dependencies {
    implementation 'gun0912.ted:tedkeyboardobserver:x.y.z'
    //implementation 'gun0912.ted:tedkeyboardobserver:1.0.0-alpha2'
}

If you think this library is useful, please press star button at upside.





How to use

TedKeyboardObserver support Listener and RxJava style

RxJava

  • You don't need dispose this observable. When activity destroy, TedRxKeyboardObserver will call onComplete()

Java

       new TedRxKeyboardObserver(this)
                .listen()
                .subscribe(isShow -> {
                            // do something
                        }, Throwable::printStackTrace);

Kotlin

       
        TedRxKeyboardObserver(this)
            .listen()
            .subscribe({ isShow -> // do something }
                , { throwable -> throwable.printStackTrace() })



Listener

Java

      new TedKeyboardObserver(this)
                .listen(isShow -> {
                    // do something
                });

Kotlin

      TedKeyboardObserver(this)
               .listen { isShow ->
                    // do something
               }

GitHub