Skip to content

Commit 5b4822a

Browse files
authored
fix(datetimepicker): spinner color not applied on Android 29+ (#620)
1 parent 0145aba commit 5b4822a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/datetimepicker/index.android.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Color } from '@nativescript/core';
1+
import { Color, Device } from '@nativescript/core';
22
import { DatePickerOptions, DateTimePickerBase, DateTimePickerStyleBase, PickerOptions, TimePickerOptions } from './common';
33
import { getDateNow, getDateToday, LocalizationUtils } from './utils';
44
export * from './ui';
@@ -274,6 +274,11 @@ export class DateTimePicker extends DateTimePickerBase {
274274
}
275275

276276
private static _applyNumberPickerColor(numberPicker: android.widget.NumberPicker, color: Color) {
277+
const sdkVersionInt = parseInt(Device.sdkVersion, 10);
278+
if (sdkVersionInt >= 29) {
279+
numberPicker.setTextColor(color.android);
280+
return;
281+
}
277282
const wheelPaint = DateTimePicker._findFieldByName(numberPicker, 'mSelectorWheelPaint');
278283
const selectionDividerDrawable = DateTimePicker._findFieldByName(numberPicker, 'mSelectionDivider');
279284
if (!wheelPaint || !selectionDividerDrawable || !(wheelPaint instanceof android.graphics.Paint) || !(selectionDividerDrawable instanceof android.graphics.drawable.Drawable)) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy