@onekeyfe/react-native-perf-stats 3.0.28 → 3.0.30
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.
- package/android/src/main/java/com/margelo/nitro/reactnativeperfstats/ReactNativePerfStats.kt +5 -1
- package/lib/typescript/src/ReactNativePerfStats.nitro.d.ts +7 -3
- package/lib/typescript/src/ReactNativePerfStats.nitro.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ReactNativePerfStats.nitro.ts +7 -3
package/android/src/main/java/com/margelo/nitro/reactnativeperfstats/ReactNativePerfStats.kt
CHANGED
|
@@ -593,7 +593,11 @@ internal object Overlay : Application.ActivityLifecycleCallbacks {
|
|
|
593
593
|
val view = overlayView ?: return
|
|
594
594
|
if (attachedToWindowManager) {
|
|
595
595
|
try {
|
|
596
|
-
|
|
596
|
+
// Use the view's own context, not currentActivity. onActivityDestroyed
|
|
597
|
+
// posts detach() to the main handler and then clears currentActivity
|
|
598
|
+
// synchronously, so by the time this runs currentActivity may already
|
|
599
|
+
// be null and the overlay would otherwise leak.
|
|
600
|
+
val wm = view.context.getSystemService(Context.WINDOW_SERVICE)
|
|
597
601
|
as? WindowManager
|
|
598
602
|
wm?.removeView(view)
|
|
599
603
|
} catch (e: Exception) {
|
|
@@ -43,9 +43,13 @@ export interface ReactNativePerfStats extends HybridObject<{
|
|
|
43
43
|
/**
|
|
44
44
|
* Show the floating overlay (CPU + RAM) drawn natively.
|
|
45
45
|
*
|
|
46
|
-
* - Android: TextView attached
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* - Android: TextView attached via `WindowManager.addView` using the
|
|
47
|
+
* current Activity's window token (window type
|
|
48
|
+
* `TYPE_APPLICATION_ABOVE_SUB_PANEL`) — no floating-window permission
|
|
49
|
+
* required, and the overlay tracks Activity lifecycle (re-attach on
|
|
50
|
+
* resume, detach on pause/destroy).
|
|
51
|
+
* - iOS: UILabel hosted on a dedicated passthrough UIWindow above the
|
|
52
|
+
* app's key window so it stays above modally-presented controllers.
|
|
49
53
|
* - Draggable on both platforms.
|
|
50
54
|
* - Idempotent. If the sampler is not running, the overlay shows "--"
|
|
51
55
|
* until `start` is called.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativePerfStats.nitro.d.ts","sourceRoot":"","sources":["../../../src/ReactNativePerfStats.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD;;;;;;;;OAQG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,+EAA+E;IAC/E,IAAI,IAAI,IAAI,CAAC;IAEb
|
|
1
|
+
{"version":3,"file":"ReactNativePerfStats.nitro.d.ts","sourceRoot":"","sources":["../../../src/ReactNativePerfStats.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD;;;;;;;;OAQG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,+EAA+E;IAC/E,IAAI,IAAI,IAAI,CAAC;IAEb;;;;;;;;;;;;;OAaG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB,gFAAgF;IAChF,WAAW,IAAI,IAAI,CAAC;IAEpB;;;;OAIG;IACH,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9B;;;;;;;;OAQG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -45,9 +45,13 @@ export interface ReactNativePerfStats
|
|
|
45
45
|
/**
|
|
46
46
|
* Show the floating overlay (CPU + RAM) drawn natively.
|
|
47
47
|
*
|
|
48
|
-
* - Android: TextView attached
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* - Android: TextView attached via `WindowManager.addView` using the
|
|
49
|
+
* current Activity's window token (window type
|
|
50
|
+
* `TYPE_APPLICATION_ABOVE_SUB_PANEL`) — no floating-window permission
|
|
51
|
+
* required, and the overlay tracks Activity lifecycle (re-attach on
|
|
52
|
+
* resume, detach on pause/destroy).
|
|
53
|
+
* - iOS: UILabel hosted on a dedicated passthrough UIWindow above the
|
|
54
|
+
* app's key window so it stays above modally-presented controllers.
|
|
51
55
|
* - Draggable on both platforms.
|
|
52
56
|
* - Idempotent. If the sampler is not running, the overlay shows "--"
|
|
53
57
|
* until `start` is called.
|