react-native-morph-card 0.1.6 → 0.1.7
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.
|
@@ -384,7 +384,10 @@ class MorphCardSourceView(context: Context) : ReactViewGroup(context) {
|
|
|
384
384
|
|
|
385
385
|
// PixelCopy captures from the surface (hardware-rendered, preserves outlines).
|
|
386
386
|
// We use a background HandlerThread for the callback to avoid deadlocking main.
|
|
387
|
-
|
|
387
|
+
// Note: context may be ThemedReactContext, not Activity directly.
|
|
388
|
+
val activity = (context as? android.app.Activity)
|
|
389
|
+
?: (context as? com.facebook.react.bridge.ReactContext)?.currentActivity
|
|
390
|
+
val window = activity?.window
|
|
388
391
|
if (window != null) {
|
|
389
392
|
val blockerBitmap = Bitmap.createBitmap(decorView.width, decorView.height, Bitmap.Config.ARGB_8888)
|
|
390
393
|
val copyThread = android.os.HandlerThread("PixelCopyThread")
|
package/package.json
CHANGED