Improving dlfallen's spreadsheet method
Re my previous post on this topic: what 'Android' seems to do is recalculate (at runtime) the position & size of a view according to the device's characteristics but 'optimises' them in some way such as using the same actual/variant ratio for both vertical & horizontal. Thus, the Left/Top/Width/Height properties are changed at runtime. This makes it difficult to replace the spreadsheet by B4A coding. So I've given up on dispensing with the spreadsheet.
I have another question. I have a layout with a number of views on it. Using the designer, some of the adjacent views have no space between them. This results in some of the views overlapping each other when ResizeViews is executed. Would this cause problems as I have LabelInformation view (created by code) in ScrollViewInformation view which overlaps with ImagePhoto view (the LabelInformation view being used to vertically scroll long text)? My guess is that the coding in ResizeViews needs to incorporate rounding to the nearest integer. Is that correct?
Spreadsheet showing L,T,W,H values:
ScrollViewInformation 0 120 210 200
ImageViewPhoto 0 320 210 160
ResizeViews (for 360x480 variant i.e. Portrait layout in the spreadsheet) extract:
ScrollViewInformation.SetLayout(0%X,25%Y,65.625%X,41.6666666666667%Y)
ImageViewPhoto.SetLayout(0%X,66.6666666666667%Y,65.625%X,33.3333333333333%Y)
Using appropriate Log statements (to show Left,Top,Width,Height) this resulted at runtime in:
ScrollViewInformation(0,120,210,200)
ImageViewPhoto(0,319,210,159)
If I'm correct, what is the best way to incorporate coding in ResizeViews?