Does anyone know of a fairly comprehensive list of layout values (width (px), height (px), densities, etc)?
The reason I ask is I'm trying to create a different layout for my app on larger screen widths (tablets in landscape).
I had my app running along nicely on my phone, nearly finished just inputting data into database as and when I get time. I kind of knew it wouldn't play nice on a tablet but didn't know for sure until I got one for my B'day. Anyways, what I would like to do is create a layout similar to the gmail app on tablets in landscape. i.e. thin menu on left, main page on right. I should be able to set the layout no problem. The problem I'm having is thinking of the parameters to define this large wide screen. I currently have :
As you can see from the code I want to lock the orientation based on device. So, if it has this big wide screen, lock orientation to landscape and use the gmail'ish layout. Otherwise, lock portrait and use the original layout.
My current parameters are min 800px wide and a 1 density though I'm sure there will be devices out there that will be missed with this. I don't imagine for one minute that all tabs a density=1. Should I set this to <=1.5?
Any tips much appreciated Thanks
This is for this app btw. If anybody looked at it before they will know the standard layout.
http://www.b4x.com/forum/basic4android-updates-questions/15136-required-permissions.html#post85848
The reason I ask is I'm trying to create a different layout for my app on larger screen widths (tablets in landscape).
I had my app running along nicely on my phone, nearly finished just inputting data into database as and when I get time. I kind of knew it wouldn't play nice on a tablet but didn't know for sure until I got one for my B'day. Anyways, what I would like to do is create a layout similar to the gmail app on tablets in landscape. i.e. thin menu on left, main page on right. I should be able to set the layout no problem. The problem I'm having is thinking of the parameters to define this large wide screen. I currently have :
B4X:
Dim DeviceValues As LayoutValues: DeviceValues = GetDeviceLayoutValues
Dim DeviceDensity As Float: DeviceDensity = Density
Log("Device Values = " & DeviceValues)
Log("Device Density = " & DeviceDensity)
If DeviceValues.Width >= 800 AND DeviceDensity = 1 Then
Constant.DeviceType = "Tablet"
Constant.DeviceOrientation = 0
Else
Constant.DeviceType = "Phone"
Constant.DeviceOrientation = 1
End If
Dim Device As Phone
Device.SetScreenOrientation(Constant.DeviceOrientation)
As you can see from the code I want to lock the orientation based on device. So, if it has this big wide screen, lock orientation to landscape and use the gmail'ish layout. Otherwise, lock portrait and use the original layout.
My current parameters are min 800px wide and a 1 density though I'm sure there will be devices out there that will be missed with this. I don't imagine for one minute that all tabs a density=1. Should I set this to <=1.5?
Any tips much appreciated Thanks
This is for this app btw. If anybody looked at it before they will know the standard layout.
http://www.b4x.com/forum/basic4android-updates-questions/15136-required-permissions.html#post85848



