App Theme does not get applied to BottomSheetDialogFragment
See original GitHub issueProblem
The App Theme does not get appplied when using BottomSheetDialogFragment
.
Reproduction steps
- Like advised, I extended
BottomSheetDialogFragment
like so:
class LoginSheet : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.login_sheet, container, false)
}
}
- Also, like advised, I use this code to show the Dialog:
LoginSheet().showNow(fragmentManager, "LoginDialog")
- The BottomSheet shows up without the desired theme.
Version number
- 1.0.0-alpha1
Operating system and device
- Android 8.1 (AOSP) on OnePlus One
Related issues
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Why is my BottomSheetDialogFragment ignoring my app ...
My app uses a dark theme, and the BottomSheetDialogFragment displays with a white background and doesn't use the accent color of my app....
Read more >Sheets: bottom - Material Design
BottomSheetDialogFragment is a subclass of AppCompatFragment, which means you need to use Activity.getSupportFragmentManager(). Note: Don't call ...
Read more >Show rounded corners for BottomSheetDialogFragment
Create custom BottomSheetDialogFragment for rounded corners as RoundedBottomSheetDialogFragment.kt ... Dialog = BottomSheetDialog(requireContext(), theme)
Read more >Using DialogFragment | CodePath Android Cliffnotes
Overview. DialogFragment is a specialized Fragment used when you want to display an overlay modal window within an activity that floats on top...
Read more >Customizing your bottom sheet's corners - Bryan Herbst
App -wide bottom sheet dialog theme. If you only want to shape your bottom sheet dialogs (both BottomSheetDialog and BottomSheetDialogFragment ), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use it like this to apply the AppTheme
This is happening because the default
bottomSheetDialogTheme
attribute points to a style that isn’t a ThemeOverlay, but rather a full theme that defines the default colors and such. This should be fixed in the library IMO.Here’s a somewhat clean workaround: