Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun getActionBarHeight(): Int {
- val styledAttributes = activity.getTheme().obtainStyledAttributes(intArrayOf(android.R.attr.actionBarSize))
- val actionBarSize = styledAttributes.getDimension(0, 0f).toInt()
- styledAttributes.recycle()
- return actionBarSize
- }
- private fun getStatusBarHeight(): Int {
- var result = 0
- val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
- if (resourceId > 0) {
- result = resources.getDimensionPixelSize(resourceId)
- }
- return result
- }
Advertisement
Add Comment
Please, Sign In to add comment