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..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 @@ -65,7 +64,6 @@ public open class NavigationDelegate( override fun onHide(context: Context) { containerView = null templatedViewMap.clear() - activeTransition = null } override fun onDestroy(context: Context) { @@ -77,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 } @@ -143,14 +140,12 @@ public open class NavigationDelegate( } else { NoAnimationTransition() } - activeTransition = transition transition.animate(from, to, direction) { if (context != null && containerView != null) { containerView!!.removeView(from) 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..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,16 +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) - set.duration = (300 * (1.0f - (from.translationX / from.width))).toLong() } - 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 8e755037..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,7 +9,6 @@ internal class IntroStep( ) : Step(IntroBinding::inflate) { override fun onShow(context: Context, binding: IntroBinding) { - binding.root.tag = "IntroStep" binding.learnMore.setOnClickListener { 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" >