Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ const config: ExpoConfig = {
"./plugins/withIosSceneLifecycle.cjs",
"./plugins/withAndroidCleartextTraffic.cjs",
"./plugins/withAndroidGradleHeap.cjs",
"./plugins/withAndroidInputBackground.cjs",
"./plugins/withAndroidModernPopupMenu.cjs",
"./plugins/withAndroidModernAlertDialog.cjs",
"./plugins/withAndroidPredictiveBackCompat.cjs",
Expand Down
27 changes: 27 additions & 0 deletions apps/mobile/plugins/withAndroidInputBackground.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { withAndroidStyles } = require("expo/config-plugins");

module.exports = function withAndroidInputBackground(config) {
return withAndroidStyles(config, (config) => {
const appTheme = config.modResults.resources.style?.find(
(style) => style.$?.name === "AppTheme",
);
if (!appTheme) {
throw new Error("withAndroidInputBackground: AppTheme is missing from styles.xml.");
}

// Inputs draw their own backgrounds and borders. Remove the native underline
// drawable so it cannot peek out beneath rounded corners or return on focus.
// Set both attributes for AppCompat and framework EditText implementations.
appTheme.item ??= [];
for (const name of ["editTextBackground", "android:editTextBackground"]) {
const existing = appTheme.item.find((item) => item.$?.name === name);
if (existing) {
existing._ = "@null";
} else {
appTheme.item.push({ $: { name }, _: "@null" });
}
}

return config;
});
};
Loading