Skip to content

[MaterialCalendar] Color surface not being applied properly #838

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

Closed
jgavazzisp opened this issue Dec 18, 2019 · 1 comment
Closed

[MaterialCalendar] Color surface not being applied properly #838

jgavazzisp opened this issue Dec 18, 2019 · 1 comment
Assignees
Labels

Comments

@jgavazzisp
Copy link

jgavazzisp commented Dec 18, 2019

Description: Full description of the issue here
When a custom theme for the DatePicker is used, "colorSurface" is ignored despite the fact of "colorPrimary", "colorOnPrimary" and "colorOnSurface" working properly.

Expected behaviour: Screenshots and/or description of expected behaviour
Attribute "colorSurface" from overwritten DatePicker theme should be used instead of the main theme "colorSurface".

Source code:
image

Android API version: 29

Material Library version: 1.2.0-alpha02

Device: Pixel 3 XL

@jgavazzisp jgavazzisp added the bug label Dec 18, 2019
@dsn5ft
Copy link
Contributor

dsn5ft commented Dec 18, 2019

Thanks for reporting this issue. My guess is that this is because we're calling getContext() again to read the colorSurface attribute, instead of using the Dialog's context which is wrapped using the DatePicker theme:

https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/datepicker/MaterialDatePicker.java#L167

I'll verify that that's the issue and submit a fix soon.

@dsn5ft dsn5ft self-assigned this Dec 18, 2019
@dsn5ft dsn5ft closed this as completed in 4e0a016 Dec 18, 2019
dsn5ft added a commit that referenced this issue Dec 18, 2019
Fixes issue where colorSurface from materialCalendarTheme is ignored

Resolves #838

PiperOrigin-RevId: 286194512
(cherry picked from commit 4e0a016)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants