Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ca3547d authored by danielwbhuang's avatar danielwbhuang
Browse files

Force keeping BottomSheetBehavior to STATE_EXPANDED

The shortcuts list in the new keyboard shortcuts UI cannot be scrolled
down easily, so we should keeping BottomSheetBehavior to STATE_EXPANDED.

Demo:https://screencast.googleplex.com/cast/NTExMzkyNTMxNTA2NzkwNHxhZTgwZjFkNC02ZA

Bug: 277139155
Test: manual
Change-Id: Ic6e6fdd27eaa1577a1977e398bb2e76218f94aca
parent 4d93facc
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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();