androidthemesmaterial-designdatepickerdialog

DatePickerDialog and Theme.MaterialComponents


I have two themes Theme.MaterialComponents.Light.DarkActionBar, and Theme.MaterialComponents. My date picker dialog is looking as expected for the first theme but for the dark theme, it shows a white background. Any ideas to make it look as expected??

  1. My datepicker in Theme.MaterialComponents.Light.DarkActionBar
  2. Date picker in Theme.MaterialComponents

Expected : I want a dark background in the second image


Solution

  • As suggested in this answer Material Components theme dialog buttons go puffy after changing theme of Application

    I used Theme.MaterialComponents.Bridge instead of Theme.MaterialComponents as parent in my dark theme.