plugins
plugins copied to clipboard
[DateTimePicker] Spinner color doesn't work in Android 29+ mSelectorWheelPaint
It seems changing the colors of the spinners in Android 29+ doesn't work anymore because using mSelectorWheelPaint
to access the field has been blocked per https://developer.android.com/about/versions/10/non-sdk-q
Landroid/widget/NumberPicker;->mSelectorWheelPaint:Landroid/graphics/Paint; # No public alternative. Developers should never access this field directly.
The below code doesn't error out bc the if
statement in the next lines check for null, but now we can't change the spinner text color. This is especially problematic for dark mode themes.
https://github.com/NativeScript/plugins/blob/a2a534b9b573d3c9728cfde4580620607d7b3a97/packages/datetimepicker/index.android.ts#L275
view.getClass().getDeclaredField('mSelectorWheelPaint')
is the issue.
https://github.com/NativeScript/plugins/blob/a2a534b9b573d3c9728cfde4580620607d7b3a97/packages/datetimepicker/index.android.ts#L299-L307
Anyone have any ideas how to fix this? Thanks.