update the way navigation bar height is calculated
This commit is contained in:
parent
c547cb3890
commit
9f08c02330
1 changed files with 11 additions and 1 deletions
|
@ -45,10 +45,20 @@ val Context.navigationBarWidth: Int get() = if (navigationBarRight) navigationBa
|
||||||
internal val Context.navigationBarSize: Point
|
internal val Context.navigationBarSize: Point
|
||||||
get() = when {
|
get() = when {
|
||||||
navigationBarRight -> Point(realScreenSize.x - usableScreenSize.x, usableScreenSize.y)
|
navigationBarRight -> Point(realScreenSize.x - usableScreenSize.x, usableScreenSize.y)
|
||||||
navigationBarBottom -> Point(usableScreenSize.x, realScreenSize.y - usableScreenSize.y)
|
navigationBarBottom -> Point(usableScreenSize.x, newNavigationBarHeight)
|
||||||
else -> Point()
|
else -> Point()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal val Context.newNavigationBarHeight: Int
|
||||||
|
get() {
|
||||||
|
var navigationBarHeight = 0
|
||||||
|
val resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android")
|
||||||
|
if (resourceId > 0) {
|
||||||
|
navigationBarHeight = resources.getDimensionPixelSize(resourceId)
|
||||||
|
}
|
||||||
|
return navigationBarHeight
|
||||||
|
}
|
||||||
|
|
||||||
internal val Context.statusBarHeight: Int
|
internal val Context.statusBarHeight: Int
|
||||||
get() {
|
get() {
|
||||||
var statusBarHeight = 0
|
var statusBarHeight = 0
|
||||||
|
|
Loading…
Reference in a new issue