Created
December 11, 2020 10:35
-
-
Save dadouf/37852a521d9ec8f4ef8b2c80dcd503dc 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
val translationDirection = if (childCenter > containerCenter) -1 else 1 | |
val translationXFromScale = translationDirection * child.width * (1 - scale) / 2f | |
child.translationX = translationXFromScale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment