@onekeyfe/react-native-device-utils 6.7.0-alpha.340 → 6.7.0-alpha.342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import android.app.Activity
4
4
  import android.content.Context
5
5
  import android.content.pm.PackageManager
6
6
  import android.graphics.Color
7
+ import android.graphics.drawable.GradientDrawable
7
8
  import android.graphics.Rect
8
9
  import android.os.Build
9
10
  import android.view.Gravity
@@ -916,9 +917,13 @@ class ReactNativeDeviceUtils : HybridReactNativeDeviceUtilsSpec(), LifecycleEven
916
917
  window.isNavigationBarContrastEnforced = false
917
918
  }
918
919
 
919
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
920
- // Android 15 enforces edge-to-edge. Keep the platform bar transparent
921
- // and draw the requested color only behind three-button navigation.
920
+ if (
921
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM ||
922
+ com.facebook.react.views.view.isEdgeToEdgeFeatureFlagOn
923
+ ) {
924
+ // Edge-to-edge windows (enforced on Android 15, opted in below it) keep
925
+ // the platform bar transparent and draw the requested color only
926
+ // behind three-button navigation.
922
927
  window.navigationBarColor = Color.TRANSPARENT
923
928
  installNavigationBarProtection(decorView, appearance.color)
924
929
  } else {
@@ -953,7 +958,6 @@ class ReactNativeDeviceUtils : HybridReactNativeDeviceUtilsSpec(), LifecycleEven
953
958
  )
954
959
  }
955
960
 
956
- protectionView.setBackgroundColor(color)
957
961
  protectionView.visibility = View.VISIBLE
958
962
  protectionView.bringToFront()
959
963
  ViewCompat.setOnApplyWindowInsetsListener(protectionView) { view, windowInsets ->
@@ -985,6 +989,17 @@ class ReactNativeDeviceUtils : HybridReactNativeDeviceUtilsSpec(), LifecycleEven
985
989
  )
986
990
  else -> Triple(0, 0, Gravity.BOTTOM)
987
991
  }
992
+ // Fade in from the content edge so the protection never draws a hard line
993
+ // against the page; the solid half keeps the buttons legible.
994
+ val fadeOrientation = when (gravity) {
995
+ Gravity.LEFT -> GradientDrawable.Orientation.RIGHT_LEFT
996
+ Gravity.RIGHT -> GradientDrawable.Orientation.LEFT_RIGHT
997
+ else -> GradientDrawable.Orientation.TOP_BOTTOM
998
+ }
999
+ view.background = GradientDrawable(
1000
+ fadeOrientation,
1001
+ intArrayOf(color and 0x00FFFFFF, color, color),
1002
+ )
988
1003
  if (
989
1004
  layoutParams.width != width ||
990
1005
  layoutParams.height != height ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-device-utils",
3
- "version": "6.7.0-alpha.340",
3
+ "version": "6.7.0-alpha.342",
4
4
  "description": "Native device, launch, system appearance and boot recovery utilities for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",