if (initialValue == 0) {
initialValue = rootViewRef.get().getHeight();
} else {
if (initialValue > rootViewRef.get().getHeight()) {
if (onKeyboardToggleListenerRef.get() != null) {
if (!hasSentInitialAction || !isKeyboardShown) {
isKeyboardShown = true;
onKeyboardToggleListenerRef.get().onKeyboardShown(initialValue - rootViewRef.get().getHeight());
}
}
} else {
if (!hasSentInitialAction || isKeyboardShown) {
isKeyboardShown = false;
rootViewRef.get().post(new Runnable() {
@OverRide
public void run() {
if (onKeyboardToggleListenerRef.get() != null) {
onKeyboardToggleListenerRef.get().onKeyboardClosed();
}
}
});
}
}
hasSentInitialAction = true;
}