From c8e40436be2b963d04734e363e8f9eabdf3e8f99 Mon Sep 17 00:00:00 2001 From: Bao Nguyen Date: Tue, 18 Aug 2026 22:16:36 +0700 Subject: [PATCH] fix(android): support inner time picker text color --- docs/android-styling.md | 1 + .../withDateTimePickerStyles.test.js | 81 +++++++++++++++++++ plugin/src/withDateTimePickerStyles.ts | 3 + 3 files changed, 85 insertions(+) create mode 100644 plugin/src/__tests__/withDateTimePickerStyles.test.js diff --git a/docs/android-styling.md b/docs/android-styling.md index 974c69f1..9dd83bae 100644 --- a/docs/android-styling.md +++ b/docs/android-styling.md @@ -69,5 +69,6 @@ The following illustrations show the different styles that can be applied to the | background | android:background | | headerBackground | android:headerBackground | | numbersBackgroundColor | android:numbersBackgroundColor | +| numbersInnerTextColor | android:numbersInnerTextColor | | numbersSelectorColor | android:numbersSelectorColor | | numbersTextColor | android:numbersTextColor | diff --git a/plugin/src/__tests__/withDateTimePickerStyles.test.js b/plugin/src/__tests__/withDateTimePickerStyles.test.js new file mode 100644 index 00000000..5a4e5d1c --- /dev/null +++ b/plugin/src/__tests__/withDateTimePickerStyles.test.js @@ -0,0 +1,81 @@ +import {promises as fs} from 'fs'; +import path from 'path'; +import {compileModsAsync} from '@expo/config-plugins'; + +import withDateTimePickerStyles from '../withDateTimePickerStyles'; + +const temporaryProjectRoots = []; + +afterEach(async () => { + await Promise.all( + temporaryProjectRoots + .splice(0) + .map((projectRoot) => fs.rm(projectRoot, {recursive: true, force: true})), + ); +}); + +const runAndroidPrebuild = async (timePicker) => { + const projectRoot = await fs.mkdtemp( + path.join(__dirname, 'android-prebuild-'), + ); + temporaryProjectRoots.push(projectRoot); + + const valuesPath = path.join(projectRoot, 'android/app/src/main/res/values'); + const valuesNightPath = path.join( + projectRoot, + 'android/app/src/main/res/values-night', + ); + + await Promise.all([ + fs.mkdir(valuesPath, {recursive: true}), + fs.mkdir(valuesNightPath, {recursive: true}), + ]); + await Promise.all([ + fs.writeFile( + path.join(valuesPath, 'styles.xml'), + '