-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
@jfversluis ...
<item name="android:datePickerDialogTheme">@style/SpinnerDatePickerStyle</item>
</style>
<style name="SpinnerDatePickerStyle" parent="Theme.AppCompat.DayNight.Dialog">
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
<item name="android:buttonBarPositiveButtonStyle">@style/DatePickerButtonStyle</item>
<item name="android:buttonBarNegativeButtonStyle">@style/DatePickerButtonStyle</item>
</style>
<style name="SpinnerDatePicker" parent="android:Widget.Material.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>
<style name="DatePickerButtonStyle" parent="Base.Widget.AppCompat.Button.Borderless">
<item name="android:textColor">#FF4081</item>
</style> I've experimented with a few different styles including a normal date picker but I couldn't get much success. Something else I noticed is that when you change theme at runtime, pickers don't change their background color until you next restart the app. Do you have any advice for what styles should be in the app itself? |
Did you change Else it would really help if you could pour this in a small reproduction so I can check it :) Just to be sure I don't miss any of the details here. Did you test without the spinner? That seems OK? |
Ah that works! :) It takes an app restart before it will switch the background colour. Should it switch instantly or is it expected that it will take an app restart?
That works too! |
Perfect, thanks! The restart is something I will look into! Don't know from the top of my head. What you could try, is take a stock(-ish, for as much as that is a thing on Android) app with a picker and see how it behaves there? |
Created a small repro on a new Xamarin 5 template (with your build's NuGet package): DarkLightPickerRepro.zip |
@BurkusCat Thank you for your patience! I think I know what you mean. The picker works fine now for me if you set the OS level dark/light theme. But doesn't respond to setting the applications theme. Right? I think I will merge this as it is for now since this is a blocker for a long time now. The actual theming would definitely be nice to have as well but is separate from this bug I would say. |
Our pickers (regular pickers) have gone crazy after updating from SR3 (yes, we lagged) to SR9. Text color in popup is white. It wasn't white before :) I have absolutely no idea what to change and where to fix this. This is what our styles.xml theme derives from:
|
@mkrnic you will probably want to change the parent to something that is Dark Theme aware, e.g.: |
We explicitly don't support dark themes for a reason, at least for now :) And this is an issue when the device is in light mode. This was fine until our XF upgrade, and I suspect this pull request broke our picker popups. Or maybe it was something else, I don't know, but this one is the only one I could find that has something to do with theming. After a lot of googling and experiments, I found something that works:
Here's the full style; I left android:textColorAlertDialogListItem inside, just in case (it's an AppCompat thing, right?):
If anyone stumbles upon this through google or any other means, hope it helps you... |
Great, thanks for sharing! This definitely was sort of a breaking change for some people, sorry about that. But in this case the pros outweighed the cons. Glad we got this figured out for you! |
Description of Change
Fixes the weird visuals of the Picker and DatePicker on Android
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
TBD
Before/After Screenshots
TBD
Testing Procedure
PR Checklist