프로젝트
GitHub에서 보기 Automatically unregistering the event on the LifecycleOwner's
yshrsmz/KeyboardVisibilityEvent
소개
소프트 키보드 표시 상태 변경 이벤트를 처리하는 Android 라이브러리입니다.
웹 및 앱 개발What you can do
- handle keyboard visibility change
- check if keyboard is currently visible
- show/hide keyboard(check UIUtil.java)
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- -3
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalKeyboardVisibilityEvent
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
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.
관련 프로젝트 살펴보기
불러오는 중…