As Klaus says !!
Thanks Klaus - you beat me to it !!
Hi BillMeyer,
Thanks a lot.
Can you share with me the modified file (you have given the screen shot but not the .BAL file)...
I still did not understand the variant part.
I mean, I tried to press F5 to 'generate the script for the variant but nothing happened !'.
Basically my thought process goes something like this:
The list of all possible device types are on the RHS panel.
I design the basic layout on my exsting device.
Then I select EACH OF THE DEVICE on the RHS, press an F5 and the 'variant specific script for that device is generated on the LHS PANEL'.
Once I have generated for all the possible (or rather available) configurations, I save the .BAL file and use it in my application.
My application should automatically detect the device dimensions and 'load the appropriate variants'.
I mean, I have not understood this thing properly as it is being used by the b4A developers in the b4A designer.
Can you please help me ...
2, member: 38943"]
@beelze69
Good Day,
I downloaded your file and took a look at it and I can see your frustration.
I suggest that you see this first:
https://www.b4x.com/android/forum/threads/b4x-anchors-demonstrated.64112/#content
Now, all my screen designs contain 2 or 3 variants (if you design for iOS with B4i - iPad is mandatory now - New Apple Policy). My device is a Samsung S8plus. So my first variant is a screen size to suit that device. I do all my design layout on that screen so that I can see what it would look like on a physical device, and here is where the trick comes in....
All my designs make use of
Anchors as explained in the link above that I included for you.
Once I am satisfied with my design, I then add a variant, let's say specifically for a tablet (800 x 1280) - in theory and if your design is good then you should see your screen adapt and fill the space. Having said that, when you run your app on a device that does not have your design resolution that device will look for the nearest fit and adapt to that size - but with anchors it now scales also.
I imported your .bal file and had a look at it (it's very complex) but I took some of your panels and configured them to use anchors, added a tablet variant and like magic all your items that I changed to use anchors magically transformed to fill the tablet screen size. I also removed your script from the scripts section and only left "AutoScaleAll"
Here is your original with some "Anchors" inserted - see only one variant
View attachment 68937
Now here is your same screen, with a tablet variant added without any other modification - looks different to your original design !! Note the grey colour around the arrows and the corresponding "white dots" on the screen design item.
View attachment 68938
Note it filled the screen "real estate" - BUT - all your scripts are gone in the script section (this is not a complete overhaul by the way)
and Finally, once you have created your "second" variant, you can adjust it with influencing your original variant.
It was very frustrating for me in the beginning as well, but once I mastered this - my design work has become so much easier and quicker.
Enjoy !![/QUOTE]