material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

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

Open AndroidDeveloperLB opened this issue 1 year ago • 2 comments

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

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.

AndroidDeveloperLB avatar Aug 05 '24 19:08 AndroidDeveloperLB

  1. The sample should match the latest APIs that are documented and recommended.

#4347

  1. The sample should be built fine using latest Android Studio version.

https://github.com/material-components/material-components-android/commit/2c2a26cd9e711fd52f1bd8cdfabce9fc5f4a4ee7

  1. 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.

https://github.com/material-components/material-components-android/commit/8fb6ea30643d8cbf2eee3b46441691f5586a9102

About navigation bar contrast: https://github.com/android/compose-samples/pull/1265 https://issuetracker.google.com/issues/326356902 https://issuetracker.google.com/issues/326819671

manabu-nakamura avatar Oct 18 '24 05:10 manabu-nakamura

@manabu-nakamura OK you need to fix it. How did you build the APK and we can't...

AndroidDeveloperLB avatar Oct 18 '24 20:10 AndroidDeveloperLB

https://github.com/material-components/material-components-android/commit/2c2a26cd9e711fd52f1bd8cdfabce9fc5f4a4ee7

manabu-nakamura avatar Mar 05 '25 05:03 manabu-nakamura