Public Sub getNavigationBarHeight(pbolPortrait As Boolean) As Int
Dim intHeight As Int
#If B4a
Dim strIdentifier As String
Dim intRessourceId As Int
Dim ctxt As JavaObject
Dim res As JavaObject
Dim ph As Phone
ctxt.InitializeContext
intHeight = 0
If ph.SdkVersion < 14 Then
Return 0
End If
If hasPermanentMenuKey Or Not(hasNavigationBar) Then
Return 0
End If
If pbolPortrait Then
strIdentifier = "navigation_bar_height"
Else
strIdentifier = "navigation_bar_width" ' Or navigation_bar_height_landscape?
End If
res = ctxt.RunMethodJO("getResources", Null)
If Not(res = Null) Then
intRessourceId = res.RunMethod("getIdentifier", Array(strIdentifier, "dimen", "android"))
If intRessourceId > 0 Then
intHeight = res.RunMethod("getDimensionPixelSize", Array(intRessourceId))
End If
End If
#Else
intHeight = 0
#End If
Return intHeight
End Sub