Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
cd0452c
Update `react-native-safe-area-context`
dmnplb Jan 13, 2025
b7c7ad2
Enable edge-to-edge navigation, fix BarcodeScanScreen
dmnplb Jan 14, 2025
b844549
Add translucent status bar to `IdentificationModal`
dmnplb Jan 14, 2025
14f0be8
Remove translucent bars from the splash screen
dmnplb Jan 14, 2025
9d19006
Slightly refactor `IdentificationModal`
dmnplb Jan 14, 2025
7521524
Fix `tsc` errors
dmnplb Jan 14, 2025
4089877
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jan 17, 2025
16bba94
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jan 21, 2025
a3dc994
Restore negative margin in `DebugInfoOverlay`
dmnplb Jan 21, 2025
f8964a5
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb May 28, 2025
d1fbaa0
Add resolution to fix `yarn` errors
dmnplb May 28, 2025
ab01e38
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb May 28, 2025
b8446c1
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb May 30, 2025
9231a73
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb May 30, 2025
e89e239
Avoid StatusBar overlap over BS backdrop
dmnplb May 30, 2025
a75d874
Add `useFooterActionsMargin` in the `LandingScreen`
dmnplb May 30, 2025
f58b679
Remove unused import
dmnplb May 30, 2025
1106f5b
Update `react-native-safe-area-context` to `5.4.1`
dmnplb May 30, 2025
798d147
Fix warning in `DSLoaders`
dmnplb May 30, 2025
3f1c30f
Update snapshots
dmnplb May 30, 2025
b4a2c52
Add temporary workaround to `useFooterActionsMargin`
dmnplb May 30, 2025
4094b9b
Update snapshots
dmnplb May 30, 2025
451f687
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jun 3, 2025
7b27cde
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jun 3, 2025
8562df5
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jun 5, 2025
0c03efd
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jun 11, 2025
643ddd2
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jun 19, 2025
ca0698b
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Jul 31, 2025
22618e3
Update `react-native-safe-area-context`
dmnplb Jul 31, 2025
07333b6
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Sep 8, 2025
f6e426f
test: update snaps
LeleDallas Sep 8, 2025
b1223bf
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 9, 2025
4070fd1
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 12, 2025
3d3dac1
Fix iOS build
dmnplb Sep 12, 2025
c30facc
Fix buggy HelpCenter on Android
dmnplb Sep 12, 2025
bef38eb
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 15, 2025
4352048
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Sep 15, 2025
c11af2b
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Sep 15, 2025
065bf5d
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 15, 2025
5d31b4f
Update the DS package version with pre-release
dmnplb Sep 15, 2025
20d1c0d
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 16, 2025
466a393
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Sep 18, 2025
2814498
feat: custom navigation Android bar color
LeleDallas Sep 18, 2025
ea9edc4
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Sep 23, 2025
46933c8
Update `package.json` and `yarn.lock`
dmnplb Sep 23, 2025
4d0e38f
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Sep 25, 2025
5c85742
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Oct 23, 2025
faba0a2
Update `jest` snapshots
dmnplb Oct 23, 2025
dd9b1b7
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Oct 23, 2025
d9e9d1a
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Oct 24, 2025
1ba26ef
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
dmnplb Oct 24, 2025
d88840f
Merge branch 'master' into IOAPPX-463-add-support-edge-to-edge-naviga…
LeleDallas Oct 24, 2025
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
5 changes: 5 additions & 0 deletions android/app/src/main/java/it/pagopa/io/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Build;
import android.os.Bundle;

import androidx.appcompat.app.AlertDialog;
import androidx.core.view.WindowCompat;

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
Expand All @@ -30,6 +31,10 @@ class MainActivity : ReactActivity() {

// https://github.com/crazycodeboy/react-native-splash-screen#third-stepplugin-configuration
override fun onCreate(savedInstanceState: Bundle?) {
// Enable edge to edge support
// https://developer.android.com/develop/ui/views/layout/edge-to-edge?hl=it
WindowCompat.setDecorFitsSystemWindows(window, false)

SplashScreen.show(this, R.style.SplashScreenTheme);
// This is needed for react-native-screens to solve the issue described here:
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704633
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MainApplication : Application(), ReactApplication {
// add(MyReactNativePackage())
add(CiePackage())
add(AppReviewPackage())
add(NavigationBarManagerPackage())
}

override fun getJSMainModuleName(): String = "index"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package it.pagopa.io.app

import android.app.Activity
import android.graphics.Color
import android.os.Build
import android.view.WindowInsetsController
import com.facebook.react.bridge.*
import com.facebook.react.module.annotations.ReactModule

@ReactModule(name = NavigationBarManagerModule.NAME)
class NavigationBarManagerModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {

companion object {
const val NAME = "NavigationBarManager"
}

override fun getName(): String {
return NAME
}

@ReactMethod
fun setNavigationBarColor(theme: String, backgroundColor: String, promise: Promise) {
val activity = currentActivity
if (activity == null) {
promise.reject("NO_ACTIVITY", "No current activity available")
return
}

try {
activity.runOnUiThread {
when (theme.lowercase()) {
"light" -> setLightNavBar(activity, backgroundColor)
"dark" -> setDarkNavBar(activity, backgroundColor)
else -> setLightNavBar(activity, backgroundColor) // Default to light
}
}
promise.resolve(true)
} catch (e: Exception) {
promise.reject("ERROR", "Failed to set navigation bar color: ${e.message}")
}
}

private fun setLightNavBar(activity: Activity, backgroundColor: String) {
val navBarColor = try {
Color.parseColor(backgroundColor)
} catch (e: IllegalArgumentException) {
Color.parseColor("#FFFFFF") // Fallback to white
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Android 11+ (API 30+)
val controller = activity.window.insetsController
controller?.setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
)
activity.window.navigationBarColor = navBarColor
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Android 8.0+ (API 26+)
activity.window.decorView.systemUiVisibility =
activity.window.decorView.systemUiVisibility or
android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
activity.window.navigationBarColor = navBarColor
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Android 5.0+ (API 21+) - no light navigation bar support
activity.window.navigationBarColor = navBarColor
}
}

private fun setDarkNavBar(activity: Activity, backgroundColor: String) {
val navBarColor = try {
Color.parseColor(backgroundColor)
} catch (e: IllegalArgumentException) {
Color.parseColor("#000000") // Fallback to black
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Android 11+ (API 30+)
val controller = activity.window.insetsController
controller?.setSystemBarsAppearance(
0,
WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
)
activity.window.navigationBarColor = navBarColor
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Android 8.0+ (API 26+)
activity.window.decorView.systemUiVisibility =
activity.window.decorView.systemUiVisibility and
android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
activity.window.navigationBarColor = navBarColor
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Android 5.0+ (API 21+)
activity.window.navigationBarColor = navBarColor
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package it.pagopa.io.app

import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager

class NavigationBarManagerPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
return listOf(NavigationBarManagerModule(reactContext))
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return emptyList()
}
}
1 change: 1 addition & 0 deletions android/app/src/main/res/layout/launch_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/ic_launcher_background"
android:fitsSystemWindows="false"
>


Expand Down
5 changes: 4 additions & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<item name="android:windowIsTranslucent">true</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>

<item name="android:navigationBarColor">@android:color/transparent</item>
<!-- Optional: set to transparent if your app is drawing behind the status bar. -->
<item name="android:statusBarColor">@android:color/transparent</item>
</style>

<style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@babel/plugin-transform-react-jsx": "^7.25.9",
"@babel/plugin-transform-regenerator": "^7.18.6",
"@gorhom/bottom-sheet": "^5.1.2",
"@pagopa/io-app-design-system": "5.11.8",
"@pagopa/io-app-design-system": "5.11.9-0",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-cie": "^1.2.0",
"@pagopa/io-react-native-cieid": "^0.3.5",
Expand Down Expand Up @@ -139,7 +139,7 @@
"react-native-push-notification": "^8.1.1",
"react-native-qrcode-svg": "^6.3.12",
"react-native-reanimated": "^3.17.5",
"react-native-safe-area-context": "^5.4.0",
"react-native-safe-area-context": "^5.5.2",
"react-native-screen-brightness": "^2.0.0-alpha",
"react-native-screens": "^4.10.0",
"react-native-screenshot-prevent": "^1.2.1",
Expand Down Expand Up @@ -292,4 +292,4 @@
}
},
"packageManager": "[email protected]"
}
}
8 changes: 7 additions & 1 deletion ts/RootContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
AppState,
AppStateStatus,
EmitterSubscription,
NativeEventSubscription
NativeEventSubscription,
StatusBar
} from "react-native";
import SplashScreen from "react-native-splash-screen";
import { connect } from "react-redux";
Expand Down Expand Up @@ -110,6 +111,11 @@ class RootContainer extends PureComponent<Props> {

return (
<>
<StatusBar
translucent
barStyle={"dark-content"}
backgroundColor={"transparent"}
/>
<IONavigationContainer />

{/* When debug mode is enabled, the following information
Expand Down
18 changes: 9 additions & 9 deletions ts/components/DebugInfoOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ import {
} from "@pagopa/io-app-design-system";

import { FunctionComponent, useState } from "react";
import {
Platform,
Pressable,
SafeAreaView,
StyleSheet,
View
} from "react-native";
import { Platform, Pressable, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { connect } from "react-redux";
import { selectItwEnv } from "../features/itwallet/common/store/selectors/environment";
import { ReduxProps } from "../store/actions/types";
Expand Down Expand Up @@ -69,11 +64,16 @@ const DebugInfoOverlay: FunctionComponent<Props> = (props: Props) => {
const [isDebugDataVisibile, showDebugData] = useState(false);
const isPagoPATestEnabled = useIOSelector(isPagoPATestEnabledSelector);

const insets = useSafeAreaInsets();

const appVersionText = `v. ${appVersion}`;

return (
<>
<SafeAreaView style={styles.versionContainer} pointerEvents="box-none">
<View
style={[styles.versionContainer, { paddingTop: insets.top }]}
pointerEvents="box-none"
>
<VStack space={4} style={{ alignItems: "center" }}>
<HStack space={4}>
<Pressable
Expand Down Expand Up @@ -123,7 +123,7 @@ const DebugInfoOverlay: FunctionComponent<Props> = (props: Props) => {
onPress={() => showDebugData(prevState => !prevState)}
/>
</VStack>
</SafeAreaView>
</View>
{isDebugDataVisibile && (
<DebugDataOverlay onDismissed={() => showDebugData(false)} />
)}
Expand Down
Loading
Loading