react-native-morph-card 0.1.7 → 0.1.8
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.
|
@@ -497,6 +497,18 @@ class MorphCardSourceView(context: Context) : ReactViewGroup(context) {
|
|
|
497
497
|
// Stop intercepting new screens — animation is taking over
|
|
498
498
|
removeHierarchyListener()
|
|
499
499
|
|
|
500
|
+
// Remove the PixelCopy blocker bitmap — it was only needed to prevent the
|
|
501
|
+
// modal screen from flashing before it was hidden. Now that the target screen
|
|
502
|
+
// is INVISIBLE, the blocker would show a stale copy of the source card
|
|
503
|
+
// at the original position while the card wrapper animates away.
|
|
504
|
+
val blockerView = wrapper.findViewWithTag<FrameLayout>("morphCardWrapper")?.let { cardW ->
|
|
505
|
+
// The blocker is any child of the overlay that isn't the card wrapper
|
|
506
|
+
(0 until wrapper.childCount).map { wrapper.getChildAt(it) }.firstOrNull { it !== cardW }
|
|
507
|
+
}
|
|
508
|
+
if (blockerView != null) {
|
|
509
|
+
wrapper.removeView(blockerView)
|
|
510
|
+
}
|
|
511
|
+
|
|
500
512
|
// Read target position (now settled after delay)
|
|
501
513
|
val d = density
|
|
502
514
|
val targetLoc = if (targetView != null) getLocationInWindow(targetView) else intArrayOf(cardLeft.toInt(), cardTop.toInt())
|
|
@@ -565,17 +577,11 @@ class MorphCardSourceView(context: Context) : ReactViewGroup(context) {
|
|
|
565
577
|
}
|
|
566
578
|
|
|
567
579
|
// Crossfade: at 15% of animation, make target screen VISIBLE with alpha=0
|
|
568
|
-
// then fade alpha to 1 over 50% of duration.
|
|
580
|
+
// then fade alpha to 1 over 50% of duration.
|
|
569
581
|
val targetScreen = targetScreenContainerRef?.get()
|
|
570
582
|
val sourceScreen2 = sourceScreenContainerRef?.get()
|
|
571
|
-
// Find the blocker image (first child of the full-screen overlay, before the card wrapper)
|
|
572
|
-
val blockerView = if (wrapper.childCount > 1) wrapper.getChildAt(0) else null
|
|
573
583
|
if (targetScreen != null && targetScreen !== sourceScreen2) {
|
|
574
584
|
mainHandler.postDelayed({
|
|
575
|
-
// Remove blocker — source screen is visible underneath
|
|
576
|
-
if (blockerView != null && blockerView.tag != "morphCardWrapper") {
|
|
577
|
-
(blockerView.parent as? ViewGroup)?.removeView(blockerView)
|
|
578
|
-
}
|
|
579
585
|
// Switch from INVISIBLE to VISIBLE but with alpha=0
|
|
580
586
|
targetScreen.alpha = 0f
|
|
581
587
|
targetScreen.visibility = View.VISIBLE
|
package/package.json
CHANGED