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

DatePicker widget does not show white background. #1410

Closed
santosh-pingle opened this issue May 20, 2022 · 5 comments · Fixed by #1411
Closed

DatePicker widget does not show white background. #1410

santosh-pingle opened this issue May 20, 2022 · 5 comments · Fixed by #1411
Assignees
Labels
type:bug Something isn't working

Comments

@santosh-pingle
Copy link
Collaborator

Describe the bug
Questionnaire theme inherits material3 theme.
It shows blue container background in date picker widget.

Component
SDC library, reference app

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
It should show white background.

Screenshots

Screen Shot 2022-05-20 at 1 00 50 PM

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

@santosh-pingle santosh-pingle self-assigned this May 20, 2022
@santosh-pingle santosh-pingle added the type:bug Something isn't working label May 20, 2022
@santosh-pingle
Copy link
Collaborator Author

With below change date picker container background color become white, but selected and current date does not show style.

<style
        name="ThemeOverlay.Questionnaire.DatePicker"
        parent="@style/ThemeOverlay.Material3.MaterialCalendar"
    >
        <item name="colorPrimary">?attr/colorSurface</item>
        <item name="colorOnPrimary">?attr/colorOnSurface</item>
</style>

so, this approach can not be used to make background white, because colorPrimary and colorOnPrimary are used to show current and selected date as well.
Screen Shot 2022-05-20 at 3 45 36 PM

@santosh-pingle
Copy link
Collaborator Author

With below change it shows date picker white background but overlaps the title "select date".

<style
        name="ThemeOverlay.Questionnaire.DatePicker"
        parent="@style/ThemeOverlay.Material3.MaterialCalendar"
    >
        <item name="android:background">?attr/colorSurface</item>
</style>

Screen Shot 2022-05-20 at 4 46 38 PM

So, can not apply this change.

@santosh-pingle
Copy link
Collaborator Author

It looks like dialog container color get applied as primaryColor value.
There is no style for dialog container which can be overridden for container color.
e.g Widget.Material3.MaterialCalendar.HeaderLayout can be used to override header background color.

@santosh-pingle
Copy link
Collaborator Author

Default datepicker material3 shows below visual.
ThemeOverlay.Material3.MaterialCalendar
Screen Shot 2022-05-20 at 5 07 47 PM

@santosh-pingle
Copy link
Collaborator Author

@shelaghm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant