Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BottomSheet] Ignores bottomSheetStyle and backgroundTint if shapeAppearance isn't set on tag #2200

Closed
AfzalivE opened this issue May 1, 2021 · 1 comment
Assignees
Labels
bug Good First Issue Issues that first time contributors can work on Widget: BottomSheet

Comments

@AfzalivE
Copy link
Contributor

AfzalivE commented May 1, 2021

Description:

Consider this XML

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/navigation_fragment"
        android:name="com.sample.app.MyFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:behavior_hideable="true"
        app:behavior_peekHeight="458dp"
        app:layout_behavior="@string/bottom_sheet_behavior"
        app:backgroundTint="@color/black" />

And bottomSheetStyle is set in themes.xml, let's assume it sets a shapeAppearanceOverlay.

Unless app:shapeAppearance="@style/ShapeAppearance.Todoist.MaterialAlertDialog" is set in the tag above, the shapeAppearanceOverlay in the bottomSheetStyle and backgroundTint attribute are ignored.

Expected behavior:
backgroundTint and bottomSheetStyle should not be ignored. I guess even if it doesn't make sense to use bottomSheetStyle to build a ShapeAppearanceModel without a shapeAppearance specified, the backgroundTint shouldn't be ignored.

Another thing is that even if backgroundTint isn't specified, I believe if colorBackground is defined in the theme, it is also not currently respected unless a shapeAppearance is specified.

Material Library version: 1.3.0

Device: Google Pixel

To help us triage faster, please check to make sure you are using the latest version of the library.

I'm not using 1.4.0-alpha but I see that this code is the same as 1.3.0:
https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java#L1325

We also happily accept pull requests.

I would gladly take that if-block outside of the if (this.shapeThemingEnabled) { block and submit a PR if anyone agrees that, at the very least, the backgroundTint/colorBackground should be applied regardless of whether a shapeAppearance is specified or not.

@AfzalivE AfzalivE added the bug label May 1, 2021
@drchen drchen self-assigned this Jun 29, 2021
@drchen drchen added Widget: BottomSheet Good First Issue Issues that first time contributors can work on labels Jan 12, 2022
@AfzalivE
Copy link
Contributor Author

Thank you @raajkumars !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Good First Issue Issues that first time contributors can work on Widget: BottomSheet
Projects
None yet
Development

No branches or pull requests

2 participants