Skip to content

Commit eefb63c

Browse files
authored
Merge pull request Expensify#69004 from margelo/@chrispader/fix-transparent-navigation-bar-in-modals
2 parents 373980a + 508747d commit eefb63c

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

patches/react-native/details.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,11 @@
189189
- Reason: This patch fixes a crash that occurred when the clipboard text data can be null.
190190
- Upstream PR/issue: 🛑
191191
- E/App issue: [#66925](https://github.com/Expensify/App/issues/66925)
192-
- PR introducing patch: [#66749](https://github.com/Expensify/App/pull/66749)
192+
- PR introducing patch: [#66749](https://github.com/Expensify/App/pull/66749)
193+
-
194+
### [react-native+0.79.2+028+fix-modal-transparent-navigation-bar.patch](react-native+0.79.2+028+fix-modal-transparent-navigation-bar.patch)
195+
196+
- Reason: This patch fixes an issue where it is not possible to enable a transparent navigation bar on Android
197+
- Upstream PR/issue: 🛑
198+
- E/App issue: [#69005](https://github.com/Expensify/App/issues/69005)
199+
- PR introducing patch: [#69004](https://github.com/Expensify/App/pull/69004)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt
2+
index 139a1c1..f6d1faa 100644
3+
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt
4+
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt
5+
@@ -361,6 +361,21 @@ public class ReactModalHostView(context: ThemedReactContext) :
6+
// Navigation bar cannot be translucent without status bar being translucent too
7+
dialogWindow.setSystemBarsTranslucency(navigationBarTranslucent)
8+
9+
+ // If enforceNavigationBarContrast is explicitly set in the app theme (AppTheme),
10+
+ // we need to override the default behaviour for edge-to-edge mode in WindowUtils.setSystemBarsTranslucency.
11+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
12+
+ val attrs = intArrayOf(android.R.attr.enforceNavigationBarContrast)
13+
+ val ta = context.obtainStyledAttributes(R.style.AppTheme, attrs)
14+
+
15+
+ if (ta.length() == 1) {
16+
+ val enforceNavigationBarContrastStyleValue = ta.getBoolean(0, false)
17+
+ dialogWindow.isNavigationBarContrastEnforced = enforceNavigationBarContrastStyleValue
18+
+ }
19+
+
20+
+ ta.recycle()
21+
+ }
22+
+
23+
+
24+
if (!navigationBarTranslucent) {
25+
dialogWindow.setStatusBarTranslucency(statusBarTranslucent)
26+
}

0 commit comments

Comments
 (0)