-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] DatePicker theming issues with Android dark mode #9033
Comments
Investigating |
Same seems to happen to the normal picker dialog. Also in the Gallery app. But only when you apply customizations. If you take out the custom styles in the |
Related to Jan6 comment by @jfversluis, removing this line from "styles.xml" cleared up the problem with the "blank" date picker.
|
@jfversluis normal picker has this problem too with the dialog. You guys have plan on fixing? Should I open another issue for that? I'm didn't found any other open about this. |
No need for a new issue! It’s clear that this happens for all the picker variations. We’re aware and hopefully get around to this soon If you have any additional information on a possible fix or cause that would be very welcome though |
I didn't spent too much time looking at it, but I'll definitely do it soon and if I found something I'll let you guys know. Best Regards. |
Are there any updates on this one? A fix is highly appreciated. |
Is there currently a workaround for this to get the DatePicker dialog to properly show in dark mode? |
The workaround I used was to add the Xamarin.Forms.Visual.Material package to my project and set the Visual property to "Material" on my datepickers. |
I did not include prereleases at first. Unfortunately it is still not solved in version 5.0.1.2031-nightly |
I see the nightly didn't run correctly over the weekend, sorry about that. Looking into it now :) |
Could you try 5.0.0.2151 from the nightly feed (note, no nightly suffix) please? :) |
The version you mention is not available to me. I guess you meant 5.0.1.2151 and not 5.0.0.2151. Do I need to add a different package source than https://aka.ms/xf-ci/index.json? |
Interesting. There is more than one nightly feed it's pushed to 😅 It's Monday, sorry! Let me dig a bit deeper. |
Hey there! Could you try this feed please? :) |
YAY YAY YAY! Thanks for confirming! This will be in the next Service Release that should be out next week if everything goes well :) |
@daniel-leinweber Hello, Could you show me the style you implemented to change the datepicker background color? |
@Jorel254 let's try the other way around; what is styles you have? :D I had to remove this to make it work: https://github.com/xamarin/Xamarin.Forms/pull/14591/files#diff-ad6ba5549da76edd8ee1934f53d44907391c58a5c8fa7071b8fd7a7e47408c9aL49 |
Sure. I use a custom control that extends the DatePicker by a "NullableDate" Property. Everything else is inherited. NullableDatePicker
For the BackgroundColor and the TextColor I use |
@Jorel254 @jfversluis @daniel-leinweber Our team just tested both ways. I can confirm this is working. |
@daniel-leinweber, @jfversluis |
Of course: |
I used this and it has reverted to pink accent on the dialog. (edited) |
@sammacdougall that's what I did too long time ago but I can't remember why that is not the best solution. |
Well if you remember then please share. I have spent to much time trying to
find a solution for this. If I have no styling it has hot pink as the
accent. Even with the xamarin forms latest library. My testers are very
pedantic and do not like this so this is the best I can come up with.
…On Thu, 21 Oct 2021, 5:59 pm mos379, ***@***.***> wrote:
@sammacdougall <https://github.com/sammacdougall> that's what I did too
long time ago but I can't remember why that is not the best solution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9033 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHTZBZQ4YBKPBGBBNVKIAP3UH7B47ANCNFSM4KACQP3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Issue fixed with appcompat theme ... but issue with ok cancel colors always pink ... was able to set colors before. |
Please open an issue if something is still not right with all the details you can get. Screenshots, and preferably a reproduction showing the issue. Thanks! |
@sammacdougall
|
Currently using dark theme (Android 11) Reproduced it here as well: XamarinForms-9033 |
While building your reproduction I noticed this in the output
Meaning, not all packages were in sync for all projects. After updating all and rebuilding, it works correctly. |
i have the same issue i used the same project in original issue up and it is not working |
@mina5500 please never paste code as a screenshot and always as text. I won't type it all over from an image :) <style name="AppCompatDialogStyle" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">#FF0000</item>
</style> remove the |
@jfversluis i already uploaded the whole project as zip file .. the screenshot was just for quick look :) |
i am confirming that it is working fine on sample solution but in my production project i am using
which causes the backgroud to mess up this was working fine in earlier versions of XF Update i added parent and it fixed my issue 😊 @jfversluis
|
Thanks for pointing it out! Completely missed that. |
- Needed to set the styles.xml colorAccent in order to affecting the picker theme accent color on Android - Initial advice from: mmazzarolo/react-native-modal-datetime-picker#106 (comment) - Actual solution inspired by: xamarin/Xamarin.Forms#9033 (comment)
Description
When using an Android device that supports dark mode (i.e. Android 10) and styles inheriting from Theme.AppCompat.DayNight, the DatePicker dialog box has a white background instead of dark gray when the device is in dark mode, resulting in unreadable text.
Related to: (#8029)
Steps to Reproduce
@style/AppCompatDialogStyle
Expected Behavior
The DatePicker is styled according to the theme, with white text on a dark background.
Actual Behavior
The DatePicker style is only partially applied, resulting in white text on a white background.
Basic Information
Screenshots
Reproduction Link
DisplayAlertTheming 2.zip
The text was updated successfully, but these errors were encountered: