Created
February 26, 2020 17:13
-
-
Save AmaroNeto/ba6433992861188a70a8ab0c268bddab 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
private fun setViewHeight() { | |
intro.viewTreeObserver.addOnGlobalLayoutListener( | |
object : OnGlobalLayoutListener { | |
override fun onGlobalLayout() { | |
oldHeight = intro.getHeight() | |
intro.viewTreeObserver.removeOnGlobalLayoutListener(this) | |
} | |
}) | |
detail.viewTreeObserver.addOnGlobalLayoutListener( | |
object : OnGlobalLayoutListener { | |
override fun onGlobalLayout() { | |
newHeight = detail.getHeight() | |
detail.viewTreeObserver.removeOnGlobalLayoutListener(this) | |
detail.visibility = View.GONE | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment