transitionx / in.arunkumarsampath.transitionx / android.view.ViewGroup / prepareTransition

prepareTransition

inline fun ViewGroup.prepareTransition(cancel: Boolean = false, transitionsBuilder: DefaultTransitionSetBuilder.() -> Unit = {}): Unit

Schedules a call to TransitionManager.beginDelayedTransition with receiver ViewGroup as the scene root. transitionsBuilder uses a TransitionSet instance internally and its properties can be modified by using available methods from DefaultTransitionSetBuilder

Usage:

constraintLayout.prepareTransition {
    changeText {
        changeTextBehavior = ChangeText.CHANGE_BEHAVIOR_OUT_IN
    }
    +textView
}
textView.setText("Hello")

Parameters

cancel - if true, ends all previous transitions before starting this transition.

transitionsBuilder - Builder to construct transition instance for use with TransitionManager

inline fun ViewGroup.prepareTransition(cancel: Boolean = false, transition: Transition): Unit

Calls TransitionManager.beginDelayedTransition with this ViewGroup and transition as the parameter.

Usage:

constraintLayout.prepareTransition(transition)

someView.hide()

Parameters

cancel - if true, ends all previous transitions before starting the transition

transition - the transition instance that should be used