Last active
December 3, 2019 14:20
-
-
Save nikhilpanju/16666645c844176ee411f73e509eb98c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cardContainer.doOnLayout { view -> | |
originalHeight = view.height | |
// show expandView and record expandedHeight in next | |
// layout pass (doOnNextLayout) and hide it immediately | |
expandView.isVisible = true | |
cardContainer.doOnNextLayout { view -> | |
expandedHeight = view.height | |
// We use post{} to hide the view. Otherwise the parent will not | |
// measure itt again, since this block is done on the layout pass | |
expandView.post { expandView.isVisible = false } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment