Created
June 27, 2018 05:11
-
-
Save shaon2016/7c840a62f26d256386fac2bed1edb51c to your computer and use it in GitHub Desktop.
This will calculate the height or width at runtime
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 measureFoodImageLayoutAtRuntime() { | |
// here adfAppBar is the root layout | |
val layoutParam = afdAppBar?.layoutParams as CoordinatorLayout.LayoutParams | |
layoutParam.height = U.getScreenHeight(this) / 3 | |
afdAppBar?.layoutParams = layoutParam | |
afdAppBar?.requestLayout() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment