Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You cannot download the library with its correction CommonUtils.kt #43

Open
LuiguiBalarezo opened this issue Dec 2, 2020 · 0 comments

Comments

@LuiguiBalarezo
Copy link

internal fun Activity.getStatusBarHeightInPx(): Int {
val rectangle = Rect()

window.decorView.getWindowVisibleDisplayFrame(rectangle)

val statusBarHeight = rectangle.top
val contentViewTop = window.findViewById<View>(Window.ID_ANDROID_CONTENT).top
return if (contentViewTop == 0) { //Actionbar is not present
    statusBarHeight
} else {
    contentViewTop - statusBarHeight
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant