| author | |
| committer | |
| log | 243e94470f80a6a5f31a68785ceff30c29ce5d4c |
| tree | 6d1ef38fda7c1d5b420371ba45bd21eb8152e19b |
| parent | 7a2cce826852c3a3255d7c7aa1e9c148287eba2c |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 28 insertions(+), 0 deletions(-)
apps/mobile/app.config.ts+1| ... | @@ -422,6 +422,7 @@ const config: ExpoConfig = { | ... | @@ -422,6 +422,7 @@ const config: ExpoConfig = { |
| 422 | "./plugins/withIosSceneLifecycle.cjs", | 422 | "./plugins/withIosSceneLifecycle.cjs", |
| 423 | "./plugins/withAndroidCleartextTraffic.cjs", | 423 | "./plugins/withAndroidCleartextTraffic.cjs", |
| 424 | "./plugins/withAndroidGradleHeap.cjs", | 424 | "./plugins/withAndroidGradleHeap.cjs", |
| 425 | "./plugins/withAndroidInputBackground.cjs", | ||
| 425 | "./plugins/withAndroidModernPopupMenu.cjs", | 426 | "./plugins/withAndroidModernPopupMenu.cjs", |
| 426 | "./plugins/withAndroidModernAlertDialog.cjs", | 427 | "./plugins/withAndroidModernAlertDialog.cjs", |
| 427 | "./plugins/withAndroidPredictiveBackCompat.cjs", | 428 | "./plugins/withAndroidPredictiveBackCompat.cjs", |
apps/mobile/plugins/withAndroidInputBackground.cjs created+27| ... | @@ -0,0 +1,27 @@ | ||
| 1 | const { withAndroidStyles } = require("expo/config-plugins"); | ||
| 2 | |||
| 3 | module.exports = function withAndroidInputBackground(config) { | ||
| 4 | return withAndroidStyles(config, (config) => { | ||
| 5 | const appTheme = config.modResults.resources.style?.find( | ||
| 6 | (style) => style.$?.name === "AppTheme", | ||
| 7 | ); | ||
| 8 | if (!appTheme) { | ||
| 9 | throw new Error("withAndroidInputBackground: AppTheme is missing from styles.xml."); | ||
| 10 | } | ||
| 11 | |||
| 12 | // Inputs draw their own backgrounds and borders. Remove the native underline | ||
| 13 | // drawable so it cannot peek out beneath rounded corners or return on focus. | ||
| 14 | // Set both attributes for AppCompat and framework EditText implementations. | ||
| 15 | appTheme.item ??= []; | ||
| 16 | for (const name of ["editTextBackground", "android:editTextBackground"]) { | ||
| 17 | const existing = appTheme.item.find((item) => item.$?.name === name); | ||
| 18 | if (existing) { | ||
| 19 | existing._ = "@null"; | ||
| 20 | } else { | ||
| 21 | appTheme.item.push({ $: { name }, _: "@null" }); | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | return config; | ||
| 26 | }); | ||
| 27 | }; | ||