https://kotlinlang.org logo
#compose
Title
# compose
m

manueldidonna

03/01/2020, 1:28 AM
When I interact with views I often need to post an action or wait until the next layout pass, etc... If I need to expand a view with an animation I can do something like this
Copy code
container.doOnLayout { 
    val originalHeight = it.height

    // expandedChild visibility was GONE
    expandedChild.isVisible = true

    view.doOnPredraw {
        val newHeight = it.height
        expandedChild.isVisible = false
    }
}
// Now I can animate the container height between originalHeight & newHeight
How Could I achieve a similar behaviour with compose?
z

Zach Klippenstein (he/him) [MOD]

03/01/2020, 8:46 AM