From 74cd7b03d5ddc66bbdaeba339c9fed45cb3719e9 Mon Sep 17 00:00:00 2001 From: Sean Amos Date: Sun, 1 Mar 2026 20:36:54 -0500 Subject: [PATCH 1/2] Revert "Clear transition after animation end. Also adjust transition duration as a function of the distance the from / to views need to travel." This reverts commit 55c9bd7fd83ed2c544746dd5d06a38859094d885. --- .../com/wealthfront/magellan/navigation/NavigationDelegate.kt | 2 -- .../com/wealthfront/magellan/transitions/DefaultTransition.kt | 1 - .../src/main/java/com/wealthfront/magellan/sample/IntroStep.kt | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt b/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt index 839d6e30..fd1159ed 100644 --- a/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt +++ b/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt @@ -65,7 +65,6 @@ public open class NavigationDelegate( override fun onHide(context: Context) { containerView = null templatedViewMap.clear() - activeTransition = null } override fun onDestroy(context: Context) { @@ -150,7 +149,6 @@ public open class NavigationDelegate( currentNavigable!!.transitionFinished() navigationPropagator.afterNavigation() containerView!!.setInterceptTouchEvents(false) - activeTransition = null } } } diff --git a/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt b/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt index d5128fab..91081ead 100644 --- a/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt +++ b/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt @@ -54,7 +54,6 @@ public class DefaultTransition : MagellanTransition { val fromTranslation = sign * -from.width val fromAnimation = ObjectAnimator.ofFloat(from, axis, from.translationX, fromTranslation.toFloat()) set.play(fromAnimation) - set.duration = (300 * (1.0f - (from.translationX / from.width))).toLong() } val toAnimation = ObjectAnimator.ofFloat(to, axis, toTranslation, 0f) diff --git a/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt b/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt index 8e755037..5da33ec2 100644 --- a/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt +++ b/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt @@ -11,6 +11,8 @@ internal class IntroStep( override fun onShow(context: Context, binding: IntroBinding) { binding.root.tag = "IntroStep" binding.learnMore.setOnClickListener { + println("viewBinding: $viewBinding") + viewBinding!! goToLearnMore() } } From 569367550dd06d3955d39554cbf4082430f953af Mon Sep 17 00:00:00 2001 From: Sean Amos Date: Sun, 1 Mar 2026 20:37:04 -0500 Subject: [PATCH 2/2] Revert "Interrupt magellan transition animation when navigating between pages to ensure intercept touch events is set and reset properly." This reverts commit 8fac1c6f1238783ccf70a9642c20bc9d0ad69ccb. --- .../wealthfront/magellan/navigation/NavigationDelegate.kt | 3 --- .../wealthfront/magellan/transitions/DefaultTransition.kt | 8 ++++---- .../java/com/wealthfront/magellan/sample/IntroStep.kt | 3 --- magellan-sample/src/main/res/layout/learn_more.xml | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt b/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt index fd1159ed..35e63f1e 100644 --- a/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt +++ b/magellan-library/src/main/java/com/wealthfront/magellan/navigation/NavigationDelegate.kt @@ -29,7 +29,6 @@ public open class NavigationDelegate( public var currentNavigableSetup: ((NavigableCompat) -> Unit)? = null - private var activeTransition: MagellanTransition? = null private var templatedViewMap = HashMap() protected var containerView: ScreenContainer? = null @@ -76,7 +75,6 @@ public open class NavigationDelegate( direction: Direction, backStackOperation: (Deque) -> MagellanTransition ) { - activeTransition?.interrupt() containerView?.setInterceptTouchEvents(true) navigationPropagator.beforeNavigation() val oldBackStack = backStack.map { it.navigable } @@ -142,7 +140,6 @@ public open class NavigationDelegate( } else { NoAnimationTransition() } - activeTransition = transition transition.animate(from, to, direction) { if (context != null && containerView != null) { containerView!!.removeView(from) diff --git a/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt b/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt index 91081ead..7e2ca88b 100644 --- a/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt +++ b/magellan-library/src/main/java/com/wealthfront/magellan/transitions/DefaultTransition.kt @@ -21,7 +21,7 @@ public class DefaultTransition : MagellanTransition { private var animator: Animator? = null override fun interrupt() { - animator?.cancel() + animator?.end() } override fun animate( @@ -48,15 +48,15 @@ public class DefaultTransition : MagellanTransition { ): AnimatorSet { val sign = direction.sign() val axis: Property = View.TRANSLATION_X - val toTranslation = sign * to.width + (from?.translationX ?: 0f) + val toTranslation = sign * to.width val set = AnimatorSet() if (from != null) { val fromTranslation = sign * -from.width - val fromAnimation = ObjectAnimator.ofFloat(from, axis, from.translationX, fromTranslation.toFloat()) + val fromAnimation = ObjectAnimator.ofFloat(from, axis, 0f, fromTranslation.toFloat()) set.play(fromAnimation) } - val toAnimation = ObjectAnimator.ofFloat(to, axis, toTranslation, 0f) + val toAnimation = ObjectAnimator.ofFloat(to, axis, toTranslation.toFloat(), 0f) set.play(toAnimation) set.interpolator = FastOutSlowInInterpolator() return set diff --git a/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt b/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt index 5da33ec2..118a1144 100644 --- a/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt +++ b/magellan-sample/src/main/java/com/wealthfront/magellan/sample/IntroStep.kt @@ -9,10 +9,7 @@ internal class IntroStep( ) : Step(IntroBinding::inflate) { override fun onShow(context: Context, binding: IntroBinding) { - binding.root.tag = "IntroStep" binding.learnMore.setOnClickListener { - println("viewBinding: $viewBinding") - viewBinding!! goToLearnMore() } } diff --git a/magellan-sample/src/main/res/layout/learn_more.xml b/magellan-sample/src/main/res/layout/learn_more.xml index 7dad975e..88ef302d 100644 --- a/magellan-sample/src/main/res/layout/learn_more.xml +++ b/magellan-sample/src/main/res/layout/learn_more.xml @@ -6,7 +6,6 @@ android:layout_height="match_parent" android:background="@color/colorCyan" android:orientation="vertical" - android:tag="LearnMore" tools:ignore="Overdraw" >