device layout variant

Cor

Active Member
Licensed User
Longtime 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
Longtime 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)
 
Upvote 0

Cor

Active Member
Licensed User
Longtime 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
 
Upvote 0

Cor

Active Member
Licensed User
Longtime 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
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime 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? :)
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime 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 :)
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime 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,
 
Upvote 0

Rusty

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