Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public class DefaultTransition : MagellanTransition {
): AnimatorSet {
val sign = direction.sign()
val axis: Property<View, Float> = View.TRANSLATION_X
val toTranslation = sign * to.width
val toTranslation = if (to.width > 0) {
sign * to.width
} else {
sign * (to.parent as View).width
}
val set = AnimatorSet()
if (from != null) {
val fromTranslation = sign * -from.width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.wealthfront.magellan.transitions

import android.os.Looper.getMainLooper
import android.view.View
import android.widget.FrameLayout
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import com.google.common.truth.Truth.assertThat
import com.wealthfront.magellan.Direction
Expand Down Expand Up @@ -47,6 +48,10 @@ class DefaultTransitionTest {
private fun animate(direction: Direction): MagellanTransition {
val from = View(getApplicationContext())
val to = View(getApplicationContext())
FrameLayout(getApplicationContext()).apply {
addView(from)
addView(to)
}
return DefaultTransition().apply {
animate(from, to, direction) {
onAnimationEndCalled = true
Expand Down
Loading