material-components / material-components/material-components-android

[BottomSheetBehavior] Allow avoiding STATE_HALF_EXPANDED

Open
#1,807 8 comments 17 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: BottomSheet
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.