Android Question Inquiries about adjusting tools

alfaiz678

Active Member
Licensed User
Inquiries about adjusting tools

To keep the tools in place as the mobile phone screens change
Is it necessary to use such codes?

Script - General:
Panel1.Height=40%y
Panel1.Width=70%x'-20dip
Panel1.Top=Label1.Bottom + 5dip
Panel1.HorizontalCenter=50%x

Or it is sufficient to arrange them on screen without code and set the Common Properties

What is the difference between adjusting tools in the design screen
Between the Script - General window
And Script-Variant
 

klaus

Expert
Licensed User
Longtime User
It always depend on what you want to do!
For me, the simplest rule is to have:
- one layout file.
- two layout variants, one for portrait and one for landscape.
- use anchors as much as possible.
- fine tuning in DesignerScripts.

Then another solution is like above, but with two layout files.
- one for small screens.
- one for big screens.
- the rest like above.

I have a project, not published, combining the second proposal above. A jukebox, playing mp3 files.
The first project I wrote was exclusively for tablets, for a friend of mine.
Then, I wanted it also on phones for myself.
So, I wrote another project for phones.
Really not efficient for maintenance!
And, of course, I thought, why having two projects with 90% of same code.
And I merged both projects into one, with:
- two layout files files.
- one for tablets.
- one for phones.
- each with different Panels.
- on tablets two Panels are displayed at the same time, and only one on the phone.
- in the code I mange the difference, really not that difficult.

This comment, just to say that it depends on the kind of project.
For me, it is an illusion to expect any 'universal' rules covering everything, apart the two suggestions above.
It is up to the developer to find the most efficient way to define layouts.
But, this needs, for sure, some experimenting to find the optimal solution.

Anyway, this is just my opinion.

What is the difference between adjusting tools in the design screen
Between the Script - General window
And Script-Variant
You can have several layout variants in a layout file.
Code in the Script-General window is valid for all variants.
Code in the Script-Variant window is valid only for the currently selected and displayed variant.
 
Last edited:
Upvote 0
Top