Android Question Designer Scripts

PABLO2013

Well-Known Member
Licensed User
Longtime User
regards
I want to know how I can improve the appearance of my application ... the problem is that the layout appears slightly below the top = 0 (blue ) position , the texts of the bar are very large and the menu does not respect the scale I 'm using the percentages % x % and...it is in sansumg Note 5

In this designer Scripts as I indicate the position of the layout or activity....

thx
 

Attachments

  • Screenshot_2015-03-31-17-34-07.png
    Screenshot_2015-03-31-17-34-07.png
    103.7 KB · Views: 201

PABLO2013

Well-Known Member
Licensed User
Longtime User
TKS, Klaus

I HAVE READ ALL FORUMS BUT ARE NOT VERY CLEAR .... WHY B4A NOT MAKE THIS automatically...

MY CODE IS IN %, I DID WITH A SMALL FORMULA THAT GIVES ME THE POSITION IN WHICH INITIALLY LOCATE THE VIEWS (TOP, LEFT, ....)

WHEN SENDING THE ALTERNATIVE 320x480, scale = 1 TO (SENT UI CLOUD) DOES MORE OR LESS AS I DESIGN, THE PROBLEM IS THAT WHEN USING REAL DEVICES LIKE (Samsung I9205 Galaxy Mega OR TABLET 10 "Samsung) THE TEXT IN THE BAR IS VERY BIG ... AND Layout IS VERY DOWN





escalatexto=0.5 I WAS TRYING TO BE ABLE TO SEE IN DIFFERENT DEVICES
escalavert=1 THIS IS NOT USED , 1
escalahor=1 THIS IS NOT USED , 1
separacionvert=1 THIS IS NOT USED , 1
separacionhor=1 THIS IS NOT USED , 1
espaciovert=0 THIS IS NOT USED , 0
espaciohor=0 THIS IS NOT USED , 0

'''''''''''''''''''''''''''''''''''''''''''''
deltatexto=100%x/320dip I WAS TRYING TO BE ABLE TO SEE IN DIFFERENT DEVICES
'''''''''''''''''''''''''''''''''''''''''''''
delta = ((100%x + 100%y) / (320dip +480dip) - 1)
rate=0.3
escala=1 '+delta*rate THIS IS NOT USED,1
'''''''''''''''''''''''''''''''''''''''''''''
AutoScaleRate(0.3)
AutoScaleAll
'''''''''''''''''''''''''''''''''''''''''''''


'Activity.left=0dip I THOUGHT THIS COULD BE .......
'Activity.Top=0dip I THOUGHT THIS COULD BE.........

Button13.left=28.6666666666667%x*escala*escalahor*separacionhor+espaciohor
Button13.top=76.4130434782609%y*escala*escalavert*separacionvert+espaciovert
Button13.width=16%x*escala*escalahor
Button13.height=4.34782608695652%y*escala*escalavert
Button13.TextSize=12*deltatexto*escalatexto

Panel6.left=1%x*escala*escalahor*separacionhor+espaciohor
Panel6.top=2.28260869565217%y*escala*escalavert*separacionvert+espaciovert
Panel6.width=48.3333333333333%x*escala*escalahor
Panel6.height=28.695652173913%y*escala*escalavert

LIKE FOR THE REST OF VIEWS

...................................................
THIS IS THE BAR

Activity.LoadLayout("COORDENADAS")

bar.Initialize("bar")

bar.NavigationMode = bar.NAVIGATION_MODE_TABS

bar.Subtitle = "TRANSFORMACION LAMBERT-CRTM05"

Activity.Title = "CRTM05"

Activity.AddMenuItem3( "MAPA" , "MAPA" , Null,True )
Activity.AddMenuItem3( "GUARDAR" , "GUARDAR" , Null,True )
Activity.AddMenuItem3( "BORRAR" , "BORRAR" , Null,True )
Activity.AddMenuItem3( "ACERCA" , "ACERCA" , Null,True )


TKS
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
It would be much easier for us to see what happens if you posted a small project showing the problem !
I don't understand your logic:
- you use formulas delta / rate / escala (which is the formula of AutoScale) ?
- then you use AutoScaleRate(0.3) and AutoScaleAll, which modifies all positions and sizes ?
- and finally, you use Button13.height=4.34782608695652%y*escala*escalavert, if you want %y why do you scale it again ?
MY CODE IS IN %
This is NOT the case see the line above !

Did you have a look at the AutoScale module ?
Did you read the relevant chapters the Beginner's Gude ?
 
Last edited:
Upvote 0

PABLO2013

Well-Known Member
Licensed User
Longtime User
GREETINGS
I ONLY AS USED % ,AutoScale All, AutoRateScale, THE REST IN THE FORMULA is 1 Or 0 (DO NOTHING) .... only the text size that has no logic (trial and error) because it was what worked, yes i look the BASIC GUIDE TO RESPECT AND FORUMS
tks
 

Attachments

  • PROYECTO-CRTM.zip
    205.3 KB · Views: 166
Upvote 0

PABLO2013

Well-Known Member
Licensed User
Longtime User
I spent revising the rest but I see that the issue of device sizes is complicated ... there will be another way ...
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The problem is the StdActionBar !
Depending on the orientation it takes extra space which is not considered in 100%y.
For StdActionBar you must add a panel for each page and load the layouts on these Panels.
When you load a layout into a Panel, 100%y correspond to the panel height and not to the Activity height.

You should read the ActionBar / Sliding Pages tutorial.
I had to do it too, because I had never used the StdActionBar.
Attached your project modified. You should adapt it according to the tutorial example program.
 

Attachments

  • PROYECTO-CRTM_1.zip
    280 KB · Views: 178
Upvote 0
Top