Slide 93
Slide 93 text
fun MotionLayout.enterPlaceholder(
listView: View,
source: T,
placeholder: T,
startState: Int,
endState: Int,
completion: () -> Unit = {}) {
// Create Bitmap from source Canvas
// TODO: Very inefficient, please fix
placeholder.applyBindingToPlaceholder(source)
// Updates starting state with constraints that match the source
val profileState = calculatePlaceholderConstraints(placeholder.root.id,
source, listView)
updateState(startState, profileState)
setTransition(startState, endState)
isVisible = true
placeholder.root.isVisible = true
MotionExtensions.kt MainActivity.kt