Created
December 11, 2020 10:40
-
-
Save dadouf/fe63f8b454dd12f289b469eaeba8a637 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
var translationXForward = 0f | |
for (i in 0 until childCount) { | |
val translationXFromScale = ... // like before | |
child.translationX = translationXForward + translationXFromScale | |
translationXForward = 0f | |
if (translationXFromScale > 0 && i >= 1) { | |
// Edit previous child | |
getChildAt(i - 1)!!.translationX += 2 * translationXFromScale | |
} else if (translationXFromScale < 0) { | |
// Pass on to next child | |
translationXForward = 2 * translationXFromScale | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment