Skip to content

Commit

Permalink
[CleanUp][BottomSheet] Simplify state transition logic
Browse files Browse the repository at this point in the history
Reduces and restructures the calling chain when a state is set to improve readability and robustness.

This CL also introduces the following fixes:

1. Limit the possible input values of setState() and throws IllegalArgumentException if invalid values are provided.
2. Block the state to be set as HIDDEN when hideable is false.
3. Fix the bug that SettleRunnable could be posted multiple times due to isPosted flag being incorrectly set to false when the settling is still going on.
4. Fix the bug that dragging the bottom sheet when settling would result the bottom sheet in an incorrect state (the target state of settling instead of DRAGGING).

PiperOrigin-RevId: 432963533
  • Loading branch information
drchen authored and veganafro committed Mar 9, 2022
1 parent 9a46af2 commit 04c483c
Showing 1 changed file with 104 additions and 139 deletions.

0 comments on commit 04c483c

Please sign in to comment.