Updated on 2026-08-14
This commit is contained in:
parent
c558292816
commit
ed8aa753ce
3 changed files with 41 additions and 24 deletions
|
|
@ -2,18 +2,15 @@ package com.tangem.tap.common.redux.navigation
|
|||
|
||||
import android.view.View
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.transition.ChangeBounds
|
||||
import androidx.transition.ChangeImageTransform
|
||||
import androidx.transition.ChangeTransform
|
||||
import androidx.transition.TransitionSet
|
||||
import org.rekotlin.Action
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
sealed class NavigationAction : Action {
|
||||
data class NavigateTo(
|
||||
val screen: AppScreen,
|
||||
val addToBackstack: Boolean = true,
|
||||
val fragmentShareTransition: FragmentShareTransition? = null
|
||||
val screen: AppScreen,
|
||||
val addToBackstack: Boolean = true,
|
||||
val fragmentShareTransition: FragmentShareTransition? = null
|
||||
) : NavigationAction()
|
||||
|
||||
data class PopBackTo(val screen: AppScreen? = null) : NavigationAction()
|
||||
|
|
@ -25,19 +22,9 @@ sealed class NavigationAction : Action {
|
|||
}
|
||||
|
||||
data class FragmentShareTransition(
|
||||
val shareElements: List<ShareElement>,
|
||||
val enterTransitionSet: TransitionSet,
|
||||
val exitTransitionSet: TransitionSet
|
||||
val shareElements: List<ShareElement>,
|
||||
val enterTransitionSet: TransitionSet,
|
||||
val exitTransitionSet: TransitionSet
|
||||
)
|
||||
|
||||
data class ShareElement(val wView: WeakReference<View>, val name: String)
|
||||
|
||||
//TODO: remove transition example
|
||||
class DetailsTransition : TransitionSet() {
|
||||
init {
|
||||
ordering = ORDERING_TOGETHER;
|
||||
addTransition(ChangeBounds())
|
||||
.addTransition(ChangeTransform())
|
||||
.addTransition(ChangeImageTransform())
|
||||
}
|
||||
}
|
||||
data class ShareElement(val wView: WeakReference<View>, val name: String)
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.tangem.tap.common.transitions
|
||||
|
||||
import androidx.transition.ChangeBounds
|
||||
import androidx.transition.ChangeImageTransform
|
||||
import androidx.transition.TransitionSet
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
class FrontCardEnterTransition : TransitionSet() {
|
||||
init {
|
||||
ordering = ORDERING_TOGETHER;
|
||||
addTransition(ChangeImageTransform())
|
||||
addTransition(ChangeBounds())
|
||||
// addTransition(Fade())
|
||||
// addTransition(Fade(Visibility.MODE_IN))
|
||||
// addTransition(ChangeTransform())
|
||||
}
|
||||
}
|
||||
|
||||
class FrontCardExitTransition : TransitionSet() {
|
||||
init {
|
||||
ordering = ORDERING_TOGETHER;
|
||||
addTransition(ChangeImageTransform())
|
||||
addTransition(ChangeBounds())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue