device layout variant

Cor

Active Member
Licensed User
my device a HUAWEI S7 has 480X800 160dpi

and i use a layout variant of the same 480x800 160dpi

However the layout variant is not loaded on my device
it uses the standard 320x480 layout

when i run emulator 480x800 160 is also not loaded with layout variant 480x800


What could be wrong?
 

Cor

Active Member
Licensed User
now i get how it is working

If (lv.width=800) AND (lv.height=480) AND (lv.Scale=1.0) Then
activity.LoadLayout("main800x480")

you have have a completed design for views otherwise
you will have to add views for each layout file (different screen)
 

Erel

Administrator
Staff member
Licensed User
It should choose the most fitting variant. In this case it should load 480x800 scale = 1.
Can you call Log(GetDeviceLayoutValues) and make sure that the values returned are what you expect?
 

Cor

Active Member
Licensed User
I got the extact values that I want

from the log file

800 x 480, scale = 1.0 (160 dpi)

Note: I use only landscape, set in project
 

Erel

Administrator
Staff member
Licensed User
Can you upload your layout file? The file that includes both variants.
 

Cor

Active Member
Licensed User
I found that i made a mistake

I had entered 480x800 in the layout variant

changed it to 800x480 scale 1

change the button layout for it, compiled and run on my huawei s7 800x480

scale 1
and guess what, it worked.

could it be that some devices uses 480x800 the smaller ones with a higher density?, that confused me
 

Erel

Administrator
Staff member
Licensed User
Many devices like Nexus One and HTC Desire are with a resolution similar to 800x480 and scale = 1.5 (240 dpi).
 

hackhack

Active Member
Licensed User
Many devices like Nexus One and HTC Desire are with a resolution similar to 800x480 and scale = 1.5 (240 dpi).
Hey, could we get that added as one of the default values in the designer 'new variant' panel? :)
 

Erel

Administrator
Staff member
Licensed User
This value is similar to 480x320 scale = 1.0. In most cases it will give you good results for all phone sized devices (3'' - 4'' sized devices).
 

hackhack

Active Member
Licensed User
Yeah I forget that, hence in the list.
But perhaps you could read the presets from a file, then we could add to that file on our own :)
 

Rusty

Well-Known Member
Licensed User
Can you advise how to implement multiple device layouts?
For example, I use a Samsung Charge which is using 320X480 and I want to install the app on a Cruz R301 which has 480X800 (both portrait only).
I would like to have the correct layout proportions show on either device automatically.
thanks,
 

Rusty

Well-Known Member
Licensed User
Thank you.
I didn't realize the variants were detected and used if available based upon device parameters.
 
Top