material-components / material-components/material-components-android
[BottomSheetBehavior] Allow avoiding STATE_HALF_EXPANDED
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
By popular request - https://stackoverflow.com/questions/59487982/android-how-to-disable-state-half-expanded-state-of-a-bottom-sheet:
- have `behavior_fitToContents = false` to try getting the view to have 2 possible states: expanded and collapsed with app defined fixed dimensions.
- a third - `STATE_HALF_EXPANDED` state and view height is introduced that's of no use.
**Describe the solution you'd like**
A `behavior_skipHalfExpanded` property/method that would have the behavior never set `STATE_HALF_EXPANDED`.
We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating BottomSheetBehavior and its existing fit-to-contents and half-expanded state handling, then inspect related tests. Define the skip behavior so fitToContents=false supports only expanded and collapsed states, and verify state transitions and the public property or method in the test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100