/KeyboardVisibilityEvent

Android Library to handle soft keyboard visibility change event.

Primary LanguageJava

KeyboardVisibilityEvent

Android Arsenal Android Gems

Android Library to handle soft keyboard visibility change event. show/hide keyboard method is also included.

Features

  • handle keyboard visibility change
  • check if keyboard is currently visible
  • show/hide keyboard(check UIUtil.java)

Please note that as described in this issue, currently the library cannot detect visibility change when the activity's windowSoftInputMode do not change Activity's height(such as adjustNothing).

Installation

AAR is distributed on the Maven Central repository.

repositories {
    mavenCentral()
}

dependencies {
    compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:1.0.1'
}

Usage

check out sample project!

Add event listener for keyboard change event

KeyboardVisibilityEvent.setEventListener(
        getActivity(),
        new KeyboardVisibilityEventListener() {
            @Override
            public void onVisibilityChanged(boolean isOpen) {
                // some code depending on keyboard visiblity status
            }
        });

License

http://www.apache.org/licenses/LICENSE-2.0.txt