Flipboard/bottomsheet
View on GitHubBug: touch event get wrong after folding soft keyborad
Open
#100 opened on Dec 11, 2015
bughelp wanted
Description
Step 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.