react-native-edge-to-edge 1.1.0 → 1.1.2

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.
@@ -3,8 +3,6 @@ package com.zoontek.rnedgetoedge
3
3
  import android.content.res.Configuration
4
4
  import android.graphics.Color
5
5
  import android.os.Build
6
- import android.os.Handler
7
- import android.os.Looper
8
6
  import android.view.WindowManager
9
7
 
10
8
  import androidx.core.content.ContextCompat
@@ -20,7 +18,7 @@ import com.facebook.react.common.ReactConstants
20
18
  object EdgeToEdgeModuleImpl {
21
19
  const val NAME = "RNEdgeToEdge"
22
20
 
23
- private fun applyEdgeToEdge(reactContext: ReactApplicationContext) {
21
+ fun applyEdgeToEdge(reactContext: ReactApplicationContext) {
24
22
  val activity = reactContext.currentActivity
25
23
  ?: return FLog.w(ReactConstants.TAG, "$NAME: Ignored, current activity is null.")
26
24
 
@@ -56,14 +54,6 @@ object EdgeToEdgeModuleImpl {
56
54
  }
57
55
  }
58
56
 
59
- fun onHostResume(reactContext: ReactApplicationContext) {
60
- applyEdgeToEdge(reactContext)
61
- }
62
-
63
- fun onConfigChange(reactContext: ReactApplicationContext) {
64
- Handler(Looper.getMainLooper()).postDelayed({ applyEdgeToEdge(reactContext) }, 100)
65
- }
66
-
67
57
  fun setSystemBarsConfig(reactContext: ReactApplicationContext, config: ReadableMap) {
68
58
  val activity = reactContext.currentActivity
69
59
  ?: return FLog.w(ReactConstants.TAG, "$NAME: Ignored, current activity is null.")
@@ -1,10 +1,5 @@
1
1
  package com.zoontek.rnedgetoedge
2
2
 
3
- import android.content.BroadcastReceiver
4
- import android.content.Context
5
- import android.content.Intent
6
- import android.content.IntentFilter
7
-
8
3
  import com.facebook.react.bridge.LifecycleEventListener
9
4
  import com.facebook.react.bridge.ReactApplicationContext
10
5
  import com.facebook.react.bridge.ReadableMap
@@ -14,19 +9,11 @@ import com.facebook.react.module.annotations.ReactModule
14
9
  class EdgeToEdgeModule(reactContext: ReactApplicationContext) :
15
10
  NativeEdgeToEdgeModuleSpec(reactContext), LifecycleEventListener {
16
11
 
17
- private val configChangeReceiver = object : BroadcastReceiver() {
18
- override fun onReceive(context: Context, intent: Intent) {
19
- EdgeToEdgeModuleImpl.onConfigChange(reactContext)
20
- }
21
- }
22
-
23
12
  init {
24
- reactApplicationContext.registerReceiver(configChangeReceiver, IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED))
25
13
  reactApplicationContext.addLifecycleEventListener(this)
26
14
  }
27
15
 
28
16
  override fun invalidate() {
29
- reactApplicationContext.unregisterReceiver(configChangeReceiver)
30
17
  reactApplicationContext.removeLifecycleEventListener(this)
31
18
  }
32
19
 
@@ -35,13 +22,17 @@ class EdgeToEdgeModule(reactContext: ReactApplicationContext) :
35
22
  }
36
23
 
37
24
  override fun onHostResume() {
38
- EdgeToEdgeModuleImpl.onHostResume(reactApplicationContext)
25
+ EdgeToEdgeModuleImpl.applyEdgeToEdge(reactApplicationContext)
39
26
  }
40
27
 
41
28
  override fun onHostPause() {}
42
29
 
43
30
  override fun onHostDestroy() {}
44
31
 
32
+ override fun onColorSchemeChange() {
33
+ EdgeToEdgeModuleImpl.applyEdgeToEdge(reactApplicationContext)
34
+ }
35
+
45
36
  override fun setSystemBarsConfig(config: ReadableMap) {
46
37
  EdgeToEdgeModuleImpl.setSystemBarsConfig(reactApplicationContext, config)
47
38
  }
@@ -1,10 +1,5 @@
1
1
  package com.zoontek.rnedgetoedge
2
2
 
3
- import android.content.BroadcastReceiver
4
- import android.content.Context
5
- import android.content.Intent
6
- import android.content.IntentFilter
7
-
8
3
  import com.facebook.react.bridge.LifecycleEventListener
9
4
  import com.facebook.react.bridge.ReactApplicationContext
10
5
  import com.facebook.react.bridge.ReactContextBaseJavaModule
@@ -16,19 +11,11 @@ import com.facebook.react.module.annotations.ReactModule
16
11
  class EdgeToEdgeModule(reactContext: ReactApplicationContext) :
17
12
  ReactContextBaseJavaModule(reactContext), LifecycleEventListener {
18
13
 
19
- private val configChangeReceiver = object : BroadcastReceiver() {
20
- override fun onReceive(context: Context, intent: Intent) {
21
- EdgeToEdgeModuleImpl.onConfigChange(reactContext)
22
- }
23
- }
24
-
25
14
  init {
26
- reactApplicationContext.registerReceiver(configChangeReceiver, IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED))
27
15
  reactApplicationContext.addLifecycleEventListener(this)
28
16
  }
29
17
 
30
18
  override fun invalidate() {
31
- reactApplicationContext.unregisterReceiver(configChangeReceiver)
32
19
  reactApplicationContext.removeLifecycleEventListener(this)
33
20
  }
34
21
 
@@ -37,13 +24,18 @@ class EdgeToEdgeModule(reactContext: ReactApplicationContext) :
37
24
  }
38
25
 
39
26
  override fun onHostResume() {
40
- EdgeToEdgeModuleImpl.onHostResume(reactApplicationContext)
27
+ EdgeToEdgeModuleImpl.applyEdgeToEdge(reactApplicationContext)
41
28
  }
42
29
 
43
30
  override fun onHostPause() {}
44
31
 
45
32
  override fun onHostDestroy() {}
46
33
 
34
+ @ReactMethod
35
+ fun onColorSchemeChange() {
36
+ EdgeToEdgeModuleImpl.applyEdgeToEdge(reactApplicationContext)
37
+ }
38
+
47
39
  @ReactMethod
48
40
  fun setSystemBarsConfig(config: ReadableMap) {
49
41
  EdgeToEdgeModuleImpl.setSystemBarsConfig(reactApplicationContext, config)
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _configPlugins = require("@expo/config-plugins");
8
- const withAndroidEdgeToEdgeTheme = (config, props) => {
8
+ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
9
9
  const themes = {
10
10
  Material2: "Theme.EdgeToEdge.Material2",
11
11
  Material3: "Theme.EdgeToEdge.Material3"
@@ -1 +1 @@
1
- {"version":3,"names":["_configPlugins","require","withAndroidEdgeToEdgeTheme","config","props","themes","Material2","Material3","ignoreList","Set","withAndroidStyles","androidStatusBar","userInterfaceStyle","barStyle","android","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","_default","exports","default","createRunOncePlugin"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAYA,MAAMC,0BAA+C,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EACzE,MAAMC,MAA8B,GAAG;IACrCC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE;EACb,CAAiC;EAEjC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yCAAyC,EACzC,yCAAyC,EACzC,kCAAkC,EAClC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;EAEF,OAAO,IAAAC,gCAAiB,EAACP,MAAM,EAAGA,MAAM,IAAK;IAC3C,MAAM;MAAEQ,gBAAgB,GAAG,CAAC,CAAC;MAAEC,kBAAkB,GAAG;IAAQ,CAAC,GAAGT,MAAM;IACtE,MAAM;MAAEU;IAAS,CAAC,GAAGF,gBAAgB;IACrC,MAAM;MAAEG,OAAO,GAAG,CAAC;IAAE,CAAC,GAAGV,KAAK;IAC9B,MAAM;MAAEW,WAAW,GAAG;IAAU,CAAC,GAAGD,OAAO;IAE3CX,MAAM,CAACa,UAAU,CAACC,SAAS,CAACC,KAAK,GAAGf,MAAM,CAACa,UAAU,CAACC,SAAS,CAACC,KAAK,EAAEC,GAAG,CACvED,KAAK,IAAmB;MACvB,IAAIA,KAAK,CAACE,CAAC,CAACC,IAAI,KAAK,UAAU,EAAE;QAC/BH,KAAK,CAACE,CAAC,CAACE,MAAM,GAAGjB,MAAM,CAACU,WAAW,CAAC,IAAI,kBAAkB;QAE1D,IAAIG,KAAK,CAACK,IAAI,IAAI,IAAI,EAAE;UACtBL,KAAK,CAACK,IAAI,GAAGL,KAAK,CAACK,IAAI,CAACC,MAAM,CAC3BD,IAAI,IAAK,CAACf,UAAU,CAACiB,GAAG,CAACF,IAAI,CAACH,CAAC,CAACC,IAAI,CACvC,CAAC;QACH;QAEA,IAAIR,QAAQ,IAAI,IAAI,EAAE;UACpBK,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAACf,QAAQ,KAAK,cAAc;UACvC,CAAC,CAAC;QACJ,CAAC,MAAM,IAAID,kBAAkB,KAAK,WAAW,EAAE;UAC7CM,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAAChB,kBAAkB,KAAK,OAAO;UAC1C,CAAC,CAAC;QACJ;MACF;MAEA,OAAOM,KAAK;IACd,CACF,CAAC;IAED,OAAOf,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,IAAA0B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,kCAAmB,EAChC9B,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_configPlugins","require","withAndroidEdgeToEdgeTheme","config","props","themes","Material2","Material3","ignoreList","Set","withAndroidStyles","androidStatusBar","userInterfaceStyle","barStyle","android","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","_default","exports","default","createRunOncePlugin"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AASA,MAAMC,0BAA+C,GAAGA,CACtDC,MAAM,EACNC,KAAK,GAAG,CAAC,CAAC,KACP;EACH,MAAMC,MAA8B,GAAG;IACrCC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE;EACb,CAAiC;EAEjC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yC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I,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAAChB,kBAAkB,KAAK,OAAO;UAC1C,CAAC,CAAC;QACJ;MACF;MAEA,OAAOM,KAAK;IACd,CACF,CAAC;IAED,OAAOf,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,IAAA0B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,kCAAmB,EAChC9B,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
@@ -5,5 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _reactNative = require("react-native");
8
- var _default = exports.default = _reactNative.TurboModuleRegistry.get("RNEdgeToEdge");
8
+ const NativeModule = _reactNative.TurboModuleRegistry.get("RNEdgeToEdge");
9
+ if (NativeModule != null) {
10
+ _reactNative.Appearance.addChangeListener(() => {
11
+ NativeModule.onColorSchemeChange();
12
+ });
13
+ }
14
+ var _default = exports.default = NativeModule;
9
15
  //# sourceMappingURL=NativeEdgeToEdgeModule.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAYpCC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","NativeModule","TurboModuleRegistry","get","Appearance","addChangeListener","onColorSchemeChange","_default","exports","default"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAaA,MAAMC,YAAY,GAAGC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC;AAElE,IAAIF,YAAY,IAAI,IAAI,EAAE;EACxBG,uBAAU,CAACC,iBAAiB,CAAC,MAAM;IACjCJ,YAAY,CAACK,mBAAmB,CAAC,CAAC;EACpC,CAAC,CAAC;AACJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcR,YAAY","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _default = exports.default = {
8
+ onColorSchemeChange() {},
8
9
  setSystemBarsConfig() {}
9
10
  };
10
11
  //# sourceMappingURL=NativeEdgeToEdgeModule.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["setSystemBarsConfig"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.web.ts"],"mappings":";;;;;;iCAEe;EACbA,mBAAmBA,CAAA,EAAG,CAAC;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["onColorSchemeChange","setSystemBarsConfig"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.web.ts"],"mappings":";;;;;;iCAEe;EACbA,mBAAmBA,CAAA,EAAG,CAAC,CAAC;EACxBC,mBAAmBA,CAAA,EAAG,CAAC;AACzB,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { createRunOncePlugin, withAndroidStyles } from "@expo/config-plugins";
4
- const withAndroidEdgeToEdgeTheme = (config, props) => {
4
+ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
5
5
  const themes = {
6
6
  Material2: "Theme.EdgeToEdge.Material2",
7
7
  Material3: "Theme.EdgeToEdge.Material3"
@@ -1 +1 @@
1
- {"version":3,"names":["createRunOncePlugin","withAndroidStyles","withAndroidEdgeToEdgeTheme","config","props","themes","Material2","Material3","ignoreList","Set","androidStatusBar","userInterfaceStyle","barStyle","android","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;AAAA,SAEEA,mBAAmB,EACnBC,iBAAiB,QACZ,sBAAsB;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AAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAACf,QAAQ,KAAK,cAAc;UACvC,CAAC,CAAC;QACJ,CAAC,MAAM,IAAID,kBAAkB,KAAK,WAAW,EAAE;UAC7CM,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAAChB,kBAAkB,KAAK,OAAO;UAC1C,CAAC,CAAC;QACJ;MACF;MAEA,OAAOM,KAAK;IACd,CACF,CAAC;IAED,OAAOd,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,eAAeH,mBAAmB,CAChCE,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createRunOncePlugin","withAndroidStyles","withAndroidEdgeToEdgeTheme","config","props","themes","Material2","Material3","ignoreList","Set","androidStatusBar","userInterfaceStyle","barStyle","android","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;AAAA,SAEEA,mBAAmB,EACnBC,iBAAiB,QACZ,sBAAsB;AAK7B,MAAMC,0BAA+C,GAAGA,CACtDC,MAAM,EACNC,KAAK,GAAG,CAAC,CAAC,KACP;EACH,MAAMC,MAA8B,GAAG;IACrCC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE;EACb,CAAiC;EAEjC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yCAAyC,EACzC,yCAAyC,EACzC,kCAAkC,EAClC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;EAEF,OAAOR,iBAAiB,CAACE,MAAM,EAAGA,MAAM,IAAK;IAC3C,MAAM;MAA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,CAAC;AACJ,CAAC;AAED,eAAeH,mBAAmB,CAChCE,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
 
3
- import { TurboModuleRegistry } from "react-native";
4
- export default TurboModuleRegistry.get("RNEdgeToEdge");
3
+ import { Appearance, TurboModuleRegistry } from "react-native";
4
+ const NativeModule = TurboModuleRegistry.get("RNEdgeToEdge");
5
+ if (NativeModule != null) {
6
+ Appearance.addChangeListener(() => {
7
+ NativeModule.onColorSchemeChange();
8
+ });
9
+ }
10
+ export default NativeModule;
5
11
  //# sourceMappingURL=NativeEdgeToEdgeModule.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAYlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Appearance","TurboModuleRegistry","NativeModule","get","addChangeListener","onColorSchemeChange"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.ts"],"mappings":";;AACA,SAASA,UAAU,EAAEC,mBAAmB,QAAQ,cAAc;AAa9D,MAAMC,YAAY,GAAGD,mBAAmB,CAACE,GAAG,CAAO,cAAc,CAAC;AAElE,IAAID,YAAY,IAAI,IAAI,EAAE;EACxBF,UAAU,CAACI,iBAAiB,CAAC,MAAM;IACjCF,YAAY,CAACG,mBAAmB,CAAC,CAAC;EACpC,CAAC,CAAC;AACJ;AAEA,eAAeH,YAAY","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  export default {
4
+ onColorSchemeChange() {},
4
5
  setSystemBarsConfig() {}
5
6
  };
6
7
  //# sourceMappingURL=NativeEdgeToEdgeModule.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["setSystemBarsConfig"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.web.ts"],"mappings":";;AAEA,eAAe;EACbA,mBAAmBA,CAAA,EAAG,CAAC;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["onColorSchemeChange","setSystemBarsConfig"],"sourceRoot":"../../../src","sources":["specs/NativeEdgeToEdgeModule.web.ts"],"mappings":";;AAEA,eAAe;EACbA,mBAAmBA,CAAA,EAAG,CAAC,CAAC;EACxBC,mBAAmBA,CAAA,EAAG,CAAC;AACzB,CAAC","ignoreList":[]}
@@ -4,7 +4,7 @@ type Props = {
4
4
  android?: {
5
5
  parentTheme?: Theme;
6
6
  };
7
- };
7
+ } | undefined;
8
8
  declare const _default: ConfigPlugin<Props>;
9
9
  export default _default;
10
10
  //# sourceMappingURL=expo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../src/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;AAE9B,KAAK,KAAK,GAAG,WAAW,GAAG,WAAW,CAAC;AAEvC,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC;CACnC,CAAC;;AA4DF,wBAGE"}
1
+ {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../src/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;AAE9B,KAAK,KAAK,GAAG,WAAW,GAAG,WAAW,CAAC;AACvC,KAAK,KAAK,GAAG;IAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE,GAAG,SAAS,CAAC;;AA+D/D,wBAGE"}
@@ -5,8 +5,9 @@ type SystemBarsConfig = {
5
5
  navigationBarHidden: boolean | undefined;
6
6
  };
7
7
  export interface Spec extends TurboModule {
8
+ onColorSchemeChange(): void;
8
9
  setSystemBarsConfig(config: SystemBarsConfig): void;
9
10
  }
10
- declare const _default: Spec | null;
11
- export default _default;
11
+ declare const NativeModule: Spec | null;
12
+ export default NativeModule;
12
13
  //# sourceMappingURL=NativeEdgeToEdgeModule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeEdgeToEdgeModule.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,gBAAgB,GAAG;IACtB,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD;;AAED,wBAA6D"}
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,KAAK,gBAAgB,GAAG;IACtB,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD;AAED,QAAA,MAAM,YAAY,aAAgD,CAAC;AAQnE,eAAe,YAAY,CAAC"}
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ onColorSchemeChange(): void;
2
3
  setSystemBarsConfig(): void;
3
4
  };
4
5
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeEdgeToEdgeModule.web.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.web.ts"],"names":[],"mappings":";;;AAEA,wBAEiB"}
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.web.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.web.ts"],"names":[],"mappings":";;;;AAEA,wBAGiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-edge-to-edge",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "license": "MIT",
5
5
  "description": "Effortlessly enable edge-to-edge display in React Native",
6
6
  "author": "Mathieu Acthernoene <zoontek@gmail.com>",
@@ -34,7 +34,7 @@
34
34
  "clean": "rm -rf dist",
35
35
  "format": "prettier '**/*' -u -w",
36
36
  "typecheck": "tsc --noEmit",
37
- "build": "yarn clean && bob build && rm -rf dist/commonjs/package.json",
37
+ "build": "yarn clean && bob build && rm -rf dist/*/package.json",
38
38
  "prepack": "prettier '**/*' -u -c && yarn typecheck && yarn build"
39
39
  },
40
40
  "react-native-builder-bob": {
@@ -58,13 +58,13 @@
58
58
  "devDependencies": {
59
59
  "@babel/core": "^7.25.2",
60
60
  "@babel/preset-env": "^7.25.3",
61
- "@expo/config-plugins": "^7.0.0 || ^8.0.0",
61
+ "@expo/config-plugins": "^7.0.0 || ^8.0.0 || ^9.0.0",
62
62
  "@types/react": "^18.2.6",
63
63
  "prettier": "^3.3.3",
64
64
  "prettier-plugin-organize-imports": "^4.1.0",
65
65
  "react": "18.3.1",
66
- "react-native": "0.76.1",
67
- "react-native-builder-bob": "^0.30.3",
66
+ "react-native": "0.76.2",
67
+ "react-native-builder-bob": "^0.31.0",
68
68
  "typescript": "^5.6.3"
69
69
  },
70
70
  "codegenConfig": {
package/src/expo.ts CHANGED
@@ -5,12 +5,12 @@ import {
5
5
  } from "@expo/config-plugins";
6
6
 
7
7
  type Theme = "Material2" | "Material3";
8
+ type Props = { android?: { parentTheme?: Theme } } | undefined;
8
9
 
9
- type Props = {
10
- android?: { parentTheme?: Theme };
11
- };
12
-
13
- const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (config, props) => {
10
+ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
11
+ config,
12
+ props = {},
13
+ ) => {
14
14
  const themes: Record<string, string> = {
15
15
  Material2: "Theme.EdgeToEdge.Material2",
16
16
  Material3: "Theme.EdgeToEdge.Material3",
@@ -1,5 +1,5 @@
1
1
  import type { TurboModule } from "react-native";
2
- import { TurboModuleRegistry } from "react-native";
2
+ import { Appearance, TurboModuleRegistry } from "react-native";
3
3
 
4
4
  type SystemBarsConfig = {
5
5
  statusBarHidden: boolean | undefined;
@@ -8,7 +8,16 @@ type SystemBarsConfig = {
8
8
  };
9
9
 
10
10
  export interface Spec extends TurboModule {
11
+ onColorSchemeChange(): void;
11
12
  setSystemBarsConfig(config: SystemBarsConfig): void;
12
13
  }
13
14
 
14
- export default TurboModuleRegistry.get<Spec>("RNEdgeToEdge");
15
+ const NativeModule = TurboModuleRegistry.get<Spec>("RNEdgeToEdge");
16
+
17
+ if (NativeModule != null) {
18
+ Appearance.addChangeListener(() => {
19
+ NativeModule.onColorSchemeChange();
20
+ });
21
+ }
22
+
23
+ export default NativeModule;
@@ -1,5 +1,6 @@
1
1
  import type { Spec } from "./NativeEdgeToEdgeModule";
2
2
 
3
3
  export default {
4
+ onColorSchemeChange() {},
4
5
  setSystemBarsConfig() {},
5
6
  } satisfies Spec;
@@ -1 +0,0 @@
1
- {"type":"module"}