plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[DateTimePicker] Spinner color doesn't work in Android 29+ mSelectorWheelPaint

Open rob4226 opened this issue 2 years ago • 0 comments

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.

rob4226 avatar Jan 17 '22 03:01 rob4226