mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
update the way navigation bar height is calculated
This commit is contained in:
@@ -45,10 +45,20 @@ val Context.navigationBarWidth: Int get() = if (navigationBarRight) navigationBa
|
||||
internal val Context.navigationBarSize: Point
|
||||
get() = when {
|
||||
navigationBarRight -> Point(realScreenSize.x - usableScreenSize.x, usableScreenSize.y)
|
||||
navigationBarBottom -> Point(usableScreenSize.x, realScreenSize.y - usableScreenSize.y)
|
||||
navigationBarBottom -> Point(usableScreenSize.x, newNavigationBarHeight)
|
||||
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
|
||||
get() {
|
||||
var statusBarHeight = 0
|
||||
|
Reference in New Issue
Block a user