Den
Den

Reputation: 1352

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

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

Upvotes: 2

Views: 236

Answers (1)

Fikru
Fikru

Reputation: 43

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

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

Hope this helps.

Upvotes: 0

Related Questions