Created
August 15, 2017 11:02
-
-
Save sagar-viradiya/7d400e40901eca6a300ca15735db2efc 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
android_bot.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { | |
override fun onGlobalLayout() { | |
flingAnimationX.setMinValue(0f).setMaxValue((screenSize.x - android_bot.width).toFloat()) | |
flingAnimationY.setMinValue(0f).setMaxValue((screenSize.y - android_bot.height).toFloat()) | |
android_bot.viewTreeObserver.removeOnGlobalLayoutListener(this) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment