Softmenu / Topbar

Silentsea

Member
Licensed User
Longtime User
Hi there,

our designer gives me a draft which I have to implement, because of the amount of devices and different screen ratios, I thought I will put a black panel in top or bottom of my layout. Maybe at the sides if it will be a device with a ratio smaller in height as the draft.

My stupid question: Is there a way to detect if the device has a softmenu or a topmenu? It cannot be the Android Version, I think I have read something about display size, that soft menus will be only on tabs. My Galaxy Tab 7.7 has a soft menu at the bottom, my old Galaxy Tab 7 has a top bar.

If there is no way I have to center the layout.
 
Last edited:

rfresh

Well-Known Member
Licensed User
Longtime User
If you use the following code to determine the screen size, it will automatically give you the working screen size that your code needs to work with.

In other words, you don't need to worry about the soft keys or where they are located.

B4X:
Sub Get_Screen_Resolution
   Main.pScreenWidth=GetDeviceLayoutValues.Width
   Main.pScreenHeight=GetDeviceLayoutValues.Height
   Main.pScale=GetDeviceLayoutValues.Scale
   If Main.pScale= 0.75 Then
   Main.pDPI="120"
   End If
   If Main.pScale= 1 Then
   Main.pDPI="160"
   End If
   If Main.pScale= 1.5 Then
   Main.pDPI="240"
   End If
   If Main.pScale=2 Then
   Main.pDPI="320"
   End If
End Sub
 
Upvote 0
Top