Merge "Force keeping BottomSheetBehavior to STATE_EXPANDED" into udc-dev

This commit is contained in:
Daniel Huang
2023-04-10 01:42:52 +00:00
committed by Android (Google) Code Review

View File

@@ -841,6 +841,19 @@ public final class KeyboardShortcutListSearch {
BottomSheetBehavior<FrameLayout> behavior = BottomSheetBehavior.from(bottomSheet);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
behavior.setSkipCollapsed(true);
behavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_DRAGGING) {
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
// Do nothing.
}
});
mKeyboardShortcutsBottomSheetDialog.setCanceledOnTouchOutside(true);
Window keyboardShortcutsWindow = mKeyboardShortcutsBottomSheetDialog.getWindow();