I rarely use B4A, but certainly in B4J I've found it to be far more straight forward than it first appeared.
You'd basically just create a class with your StatusBarHeight sub and a sub with whatever you want to do with it :
[CODE lang="b4x" title="Desinger Script Claa"]'Class named DSE_SBH'
'Parameters: panel that you want to adjust
Private Sub SetPanelBasedOnSHeight(DesignerArgs As DesignerArgs)
Dim Panel As B4XView = DesignerArgs.GetViewFromArgs(0)
Panel.Top = StatusBarHeight 'for example
End Sub
Private Sub StatusBarHeight As Int
Dim sHeight As Int
Dim jo As JavaObject
jo.InitializeContext
Try
Dim res As JavaObject = jo.RunMethod("getResources", Null)
Dim resourceId As Int = res.RunMethod("getIdentifier", Array("status_bar_height", "dimen", "android"))
If resourceId > 0 Then
sHeight = res.RunMethod("getDimensionPixelSize", Array(resourceId))
End If
Catch
Log("Fehler beim Verschieben: " & LastException.Message)
End Try
Return sHeight
End Sub[/CODE]
Then call it from the layout's script:
[CODE lang="b4x" title="In layout script"]DSE_SBH.SetPanelBasedOnSHeight(Panel1)[/CODE]
Or something like that (code written on the fly)!