KeyboardVisibilityEvent

Android Library to handle keyboard visibility change with ease.

Лицензия

Лицензия

Категории

Категории

Сеть KeY Данные Data Formats Formal Verification
Группа

Группа

net.yslibrary.keyboardvisibilityevent
Идентификатор

Идентификатор

keyboardvisibilityevent
Последняя версия

Последняя версия

3.0.0-RC3
Дата

Дата

Тип

Тип

aar
Описание

Описание

KeyboardVisibilityEvent
Android Library to handle keyboard visibility change with ease.
Ссылка на сайт

Ссылка на сайт

https://github.com/yshrsmz/KeyboardVisibilityEvent
Система контроля версий

Система контроля версий

https://github.com/yshrsmz/KeyboardVisibilityEvent

Скачать keyboardvisibilityevent

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.yslibrary.keyboardvisibilityevent/keyboardvisibilityevent/ -->
<dependency>
    <groupId>net.yslibrary.keyboardvisibilityevent</groupId>
    <artifactId>keyboardvisibilityevent</artifactId>
    <version>3.0.0-RC3</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/net.yslibrary.keyboardvisibilityevent/keyboardvisibilityevent/
implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3'
// https://jarcasting.com/artifacts/net.yslibrary.keyboardvisibilityevent/keyboardvisibilityevent/
implementation ("net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC3")
'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:aar:3.0.0-RC3'
<dependency org="net.yslibrary.keyboardvisibilityevent" name="keyboardvisibilityevent" rev="3.0.0-RC3">
  <artifact name="keyboardvisibilityevent" type="aar" />
</dependency>
@Grapes(
@Grab(group='net.yslibrary.keyboardvisibilityevent', module='keyboardvisibilityevent', version='3.0.0-RC3')
)
libraryDependencies += "net.yslibrary.keyboardvisibilityevent" % "keyboardvisibilityevent" % "3.0.0-RC3"
[net.yslibrary.keyboardvisibilityevent/keyboardvisibilityevent "3.0.0-RC3"]

Зависимости

runtime (2)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.30
androidx.lifecycle » lifecycle-runtime-ktx jar 2.3.0

Модули Проекта

Данный проект не имеет модулей.

KeyboardVisibilityEvent

Android Arsenal Android Gems Maven Central

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

Library's status

Currently I don't have enough time to maintain this library, so I leave this as it is.
I'm going to merge PRs when they arrive though ;)

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 via Maven Central. The latest version is Maven Central

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

Usage

check out sample project!

Add event listener for keyboard change event

Automatically unregistering the event on the Activity's onDestroy

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

Automatically unregistering the event on the LifecycleOwner's ON_DESTROY

This is convenient when you want to KeyboardVisibilityEvent from a Fragment.

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

Manually unregistering the event

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

// call this method when you don't need the event listener anymore
unregistrar.unregister();

License

Copyright 2015-2021 Shimizu Yasuhiro (yshrsmz)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Версии библиотеки

Версия
3.0.0-RC3
3.0.0-RC2
3.0.0-RC1
2.3.0
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
1.0.1
1.0.0