android - MaterialDatePicker Fullscreen: can't change black statusbar color

219 Views Asked by At

I have a problem with MaterialDatePicker. When I'm trying to open it in fullscreen, my statusbar becomes black. I've tried to create my own Theme with parent="ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen" and override statusBarColor but it did nothing.

Also, I've tried to set windowTranslucentStatus - this is the only attribute I've found so far that applies a single change to statusbar. It becomes translucent but only a little and almost impossible to see.

The code I'm using to show MaterialDatePicker:

                val x = MaterialDatePicker.Builder.dateRangePicker()
                .setTitleText("Select period")
                .setTheme(R.style.ThemeOverlay_MaterialComponents_MaterialCalendar_Fullscreen)
                .build()

            x.show(supportFragmentManager, "datePicker")

Black statusbar

1

There are 1 best solutions below

0
On

Change your app's theme to Light theme. For example,

<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">

Hope this helps.