Skip to content

Commit 1151582

Browse files
committed
1.fix a bug that the SoftKeyboard lost KeyEvent in fullscreen;
2.fix a demo bug about qqkeyboard, can't scroll to bottom when keyboard pop up;
1 parent 64c2aa6 commit 1151582

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ and:
5757

5858
```xml
5959
dependencies {
60-
compile 'com.github.w446108264:XhsEmoticonsKeyboard:2.0.1'
60+
compile 'com.github.w446108264:XhsEmoticonsKeyboard:2.0.2'
6161
}
6262
```
6363

XhsEmoticonsKeyboard/app/src/main/java/com/xhsemoticonskeyboard/qq/QqEmoticonsKeyBoard.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ protected void setFuncViewHeight(int height) {
205205
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) lyKvml.getLayoutParams();
206206
params.height = height;
207207
lyKvml.setLayoutParams(params);
208+
OnSoftPop(height);
208209
}
209210

210211
@Override

XhsEmoticonsKeyboard/library/src/main/java/sj/keyboard/XhsEmoticonsKeyBoard.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import android.text.TextUtils;
88
import android.text.TextWatcher;
99
import android.util.AttributeSet;
10-
import android.util.Log;
1110
import android.view.KeyEvent;
1211
import android.view.LayoutInflater;
1312
import android.view.MotionEvent;
@@ -307,14 +306,29 @@ public void requestChildFocus(View child, View focused) {
307306
}
308307

309308
public boolean dispatchKeyEventInFullScreen(KeyEvent event) {
309+
if(event == null){
310+
return false;
311+
}
310312
switch (event.getKeyCode()) {
311313
case KeyEvent.KEYCODE_BACK:
312314
if (EmoticonsKeyboardUtils.isFullScreen((Activity) getContext()) && mLyKvml.isShown()) {
313315
reset();
314316
return true;
315317
}
318+
default:
319+
if(event.getAction() == KeyEvent.ACTION_DOWN){
320+
boolean isFocused;
321+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
322+
isFocused = mEtChat.getShowSoftInputOnFocus();
323+
} else {
324+
isFocused = mEtChat.isFocused();
325+
}
326+
if(isFocused){
327+
mEtChat.onKeyDown(event.getKeyCode(), event);
328+
}
329+
}
330+
return false;
316331
}
317-
return false;
318332
}
319333

320334
public EmoticonsEditText getEtChat() { return mEtChat; }

0 commit comments

Comments
 (0)