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

[BottomSheet] sample can't be built, docs and sample don't match, and missing information of edge-to-edge

Open
#4,253 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Issue: Catalog
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** Full description of issue here
Right now, if you check the sample "catalog" and reach the bottom sheet code, you will see it's quite old, not matching the docs, and even reaches protected API of the library:

https://github.com/material-components/material-components-android/blob/629e24f147755150a6769768832a150686a9d2ff/catalog/java/io/material/catalog/bottomsheet/BottomSheetScrollableContentDemoFragment.java#L57

The docs say to use "enableEdgeToEdge " and setting "navigationBarColor" to be transparent, but the sample doesn't have any of these:

https://github.com/material-components/material-components-android/blob/master/docs/components/BottomSheet.md#setting-behavior:~:text=On%20API%2021%20and%20above%20the%20modal%20bottom%20sheet%20will%20be%20rendered%20fullscreen%20(edge%20to%20edge)%20if%20the%20navigation%20bar%20is%20transparent%20and%20app%3AenableEdgeToEdge%20is%20true.%20To%20enable%20edge%2Dto%2Dedge%20by%20default%20for%20modal%20bottom%20sheets%2C%20you%20can%20override%20%3Fattr/bottomSheetDialogTheme%20like%20the%20below%20example%3A

Not to mention the sample doesn't even build fine, so I can't run it to see how well it works other than using the release-apk of the repository.

[studio64_2024-08-05_21-53-35.zip](https://github.com/user-attachments/files/16501863/studio64_2024-08-05_21-53-35.zip)

**Expected behavior:** Screenshots and/or description of expected behavior
1. The sample should match the latest APIs that are documented and recommended.
2. The sample should be built fine using latest Android Studio version.
3. The docs should mention what it means `app:enableEdgeToEdge is true`, because it doesn't show it in the snippets and doesn't mention it anywhere there, of where to put it.

**Source code:** The code snippet which is causing this issue
All here (sadly can't attach, as it's beyond max attachment file limits) :
https://github.com/material-components/material-components-android

**Minimal sample app repro:** Please consider attaching a minimal sample app that reproduces the issue. This will help narrow down the conditions required for reproducing the issue, and it will speed up the bug fix process. You may attach a zip file of the sample app or link to a GitHub repo that contains the sample app.
All here (sadly can't attach, as it's beyond max attachment file limits) :
https://github.com/material-components/material-components-android

**Android API version:** Android API version here
It's before reaching this phase.

**Material Library version:** Material Android Library version you are using here (e.g., 1.1.0-alpha07)
1.13.0-alpha04

**Device:** Device on which the bug was encountered here
PC.

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 with catalog/java/io/material/catalog/bottomsheet/BottomSheetScrollableContentDemoFragment.java and compare it with docs/components/BottomSheet.md. Run the catalog/sample build to identify the current failure and inspect how the documented edge-to-edge configuration applies. Done means the sample builds, uses the documented APIs, and the docs explain where app:enableEdgeToEdge belongs.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
build-system, documentation, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.