Bug: touch event get wrong after folding soft keyborad
See original GitHub issueStep 1: open bottom sheet and expanded it to top. There is a recyclerView which contains EditText items in bottom sheet; Step 2: click any EditText then soft keyboard shows; Step 3: fold the soft keyboard. And now bottom sheet keeps peeked state. Step 4: click top item of recyclerView, the bug is bottom sheet auto hides. Even if I touch the item at bottom position, the bottom sheet doesn’t work normally.
After reading source code, I think the problem happens here:(BottomSheetLayout.class line 669)
sheetViewOnLayoutChangeListener = new OnLayoutChangeListener() {
@Override
public void onLayoutChange(View sheetView, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
int newSheetViewHeight = sheetView.getMeasuredHeight();
if (state != State.HIDDEN && newSheetViewHeight < currentSheetViewHeight) {
// The sheet can no longer be in the expanded state if it has shrunk
if (state == State.EXPANDED) {
setState(State.PEEKED);
}
setSheetTranslation(newSheetViewHeight);
}
currentSheetViewHeight = newSheetViewHeight;
}
};
When soft keyboard is fold, the code “setSheetTranslation(newSheetViewHeight);” isn’t execute. This makes onTouchEvent works abnormally.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
Top Results From Across the Web
touchEvent while typing with soft keyboard android
I have already tried using dispatchTouchEvent(MotionEvent) on the main activity, but during the typing this event is not fired. Is there a way...
Read more >X1-Fold-Bugs-Fix - English Community - Lenovo Forums
Hi guys, first post here. New owner of the X1 Fold, had it for about a week so far, and there are some...
Read more >Need a way to disable on-screen-keyboard (OSK) - GitLab
It is very frustrating to see the on-screen-keyboard popping up while having a real keyboard connected, is there any way to disable the...
Read more >Keyboard is not working on Galaxy phone or tablet - Samsung
If the on-screen keyboard isn't working or is unresponsive, you can fix it by optimizing your device, restarting it, or performing some other...
Read more >Dell 2-in-1 Laptop Touchpad or Keyboard May Stop ...
Dell 2-in-1 laptops that have a tablet mode, may experience the touchpad or keyboard not working in the Operating System (OS) or in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here. This is a serious bug if you are working with any kind of text input/soft keyboard.
What is the use-case for that made you add it?
Can you give me some input?
same problem, contains EditText items in bottomsheet I have an idea:
hope a better idea