Android Question DESIGNER SCRIPT AND AUTOSCALE HELP

Gianni Sassanelli

Active Member
Licensed User
Longtime User
Hi expert,
i'm new with B4A I am learning and venturing with design scripts.

I have tried to make a simply window as the exampleimage.jpg.
Well
If i start a new layout.bal from a 480 x 320 x 1.0 version of designer, it scale well on almost all resolutions of the device

If i create another layout2.bal but this time I start from a 1280x800 x 1.0 version of designer, and remove the 480x320 version, i have a WRONG scaled with other device having resolution different from 1280 x 800

I need to develop an APP for a tablet in landscape and I would like to start with this more large resolution

can someone help me please

thank's
exampleimage.png
 

Gianni Sassanelli

Active Member
Licensed User
Longtime User
Hi NJ,
in effect your example work but there are 2 problem:
1° you have created the layout with base resolution 320x480 portrait and 480x320 landscape. If you try to do the same with 1280x800 resolution it fails
2° only panel are scaled! if you insert label , imageview, buttons or textbox in panel, all this views NOT ARE SCALED
 
Upvote 0

Gianni Sassanelli

Active Member
Licensed User
Longtime User
thank's for all
For EREL:
i start with 1280x800 scale factor = 1 layout then try to use in 1920x1080 scale factor =3 and not scale
in SCRIPT GENERAL i have only AUTOSCALEALL ( with 1280x800 work fine but with 1920x1080 don't scale)
i have tried to add
AUTOSCALEALL in SCRIPT VARIANT tabs also and now it scale with other resolution!!!

hi luca i have created new layout and the designer start with 320x240. i don't add any view
after i have added a new variant (1280x800) , deleted the first variant
now i have added my view (panel, button and label) in 1280x800 variant. the behaviour is that i ha ve just descripted to Erel

Is it a bug?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
hi luca i have created new layout and the designer start with 320x240. i don't add any view
after i have added a new variant (1280x800) , deleted the first variant
now i have added my view (panel, button and label) in 1280x800 variant.
I commented this your statement:
1° you have created the layout with base resolution 320x480 portrait and 480x320 landscape. If you try to do the same with 1280x800 resolution it fails
His layout, with his script, works well also adding a new variant (1280x800) (then you can remove the other 2 variants). I did it and I attached the layout file I modified this way.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Hi NJ,
in effect your example work but there are 2 problem:
1° you have created the layout with base resolution 320x480 portrait and 480x320 landscape. If you try to do the same with 1280x800 resolution it fails
2° only panel are scaled! if you insert label , imageview, buttons or textbox in panel, all this views NOT ARE SCALED
As I stated on my original post, that code works ON ANY SCREEN SIZE AND RESOLUTION, so, what you are saying in #1 is wrong.

Now, on your sample you only have PANELS, so, then again the code I posted is right, HOWEVER, you are adding views to them (ImageView, Button, etc) and that is where you are wrong again, if you are adding views to those panels you must also position/scale those views accordingly in relation to the panels dimensions, you have to use the scripts to sized them properly.
 
Last edited:
Upvote 0

Gianni Sassanelli

Active Member
Licensed User
Longtime User
As I stated on my original post, that code works ON ANY SCREEN SIZE AND RESOLUTION, so, what you are saying in #1 is wrong.

Now, on your sample you only have PANELS, so, then again the code I posted is right, HOWEVER, you are adding views to them (ImageView, Button, etc) and that is where you are wrong again, if you are adding views to those panels you must also position/scale those views accordingly in relation to the panels dimensions, you have to use the scripts to sized them properly.

your answer is right!
i have solved by adding AUTOSCALEALL in SCRIPT VARIANT tabs for 1280x800 variant. NOW it scale with other resolution!!!

thank's for your help
 
Upvote 0
Top