Scaling & Panels

duneplodder

Active Member
Licensed User
Longtime User
Another layout question I'm afraid.

I've done most of my (first) project using a phone (Wildfire S). I'd had a look at the way a layout would scale on different screens by checking on the emulator which seemed reasonable. For the moment I would be happy to know that the software will work on a tablet, even though not optimised.

Since then though I have begun using panels for input rather than separate layouts. A mistake, I think, as panels don't seem to scale with the layout.

It looks like I will either have to run through many screen sizes/densities adjusting panels & child views, or replace the panels with layouts. Am I correct?

Anyone any comments or suggestions?

Robert
 

duneplodder

Active Member
Licensed User
Longtime User
I'll answer my own question - I'm wrong, panels do scale.

I had confused myself by selecting different layout options in Designer. If I stick with the basic 320 x 480 & remove other layouts then everything scales as I'd hoped.

They say we learn by our mistakes..
 
Upvote 0

duneplodder

Active Member
Licensed User
Longtime User
Err, on second thoughts, no they don't seem to scale as I expected.

I'd seen the Wiki Designer page which refers to screenshots of a 7" & scaled 10" screen:
Designer - Basic4android Wiki
These seemed pretty much what I was hoping for.

However if I create a layout for a default 320x480 with a button in each corner & then view them in various emulator sizes I get the results seen in the attached screenshots.

Are they what you would expect, or does the emulator do something different to a real tablet?
Or am I getting very confused about screen densities etc!

Thank you.
Robert
 

Attachments

  • 320x480.JPG
    320x480.JPG
    25.3 KB · Views: 162
  • 480x800.JPG
    480x800.JPG
    32.6 KB · Views: 174
  • 600x1024 Tab.JPG
    600x1024 Tab.JPG
    32.4 KB · Views: 197
Upvote 0

klaus

Expert
Licensed User
Longtime User
I agree with NJDude.
You need to have at least two layout variants (one portrait, one landscape) for each screen size with the standard density of 160 dpi.
If you have several devices with a screen size about 3.5 '' but with different densities, two layout variants could be enough, the dip (density independant pixels) dimensions will adjust the layout, but there are different width/height ratios to take into account. These could need either new layout variants or adjustments in the code.
But if you have a screen with a size of 3.5 '' density 160 and another screen with a size of 7 '' density 160. The second screen has a surface 4 times bigger than the first one. Then you need to define what you want to display on the big surface, the same layout but streched or more information on the same screen. For me, streching the layout of the small size proportionally to big size is not a solution, so you will need two more layout variants. This is valid for the different screen sizes. Do you want to diasplay the same information on a 10 '' screen as on a 7 '' screen ? Depending on your answer, you would need two more variants and so on.
Yes, it's becoming a mess, but that's it.
Some users are defining the layouts by code, some others make a mix between layout variants adapted in the code. There are no strict rules, it depends on what you really want to do.

Best regards.
 
Upvote 0

duneplodder

Active Member
Licensed User
Longtime User
Thank you all for your replies.

I was trying to keep things simple for the moment, concentrating on phone screens but still being useable on a tablet.

It doesn't seem to be possible to use %x or %y in the designer so I would need to do it from code.

The samples on the Designer Wiki screenshots appeared to do what I hoped - thought it was too good to be true! Obviously there is no easy way.
Thanks again.
Robert
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I'd seen the Wiki Designer page which refers to screenshots of a 7" & scaled 10" screen:
Designer - Basic4android Wiki
These seemed pretty much what I was hoping for.,,

However if I create a layout for a default 320x480 with a button in each corner & then view them in various emulator sizes I get the results seen in the attached screenshots.

There are 3 screen shots linked in the Introduction section of the Wiki page you referenced. The first one shows a layout on a 7" scale 1 screen and the second one, the same layout on a 10" scale 1 screen with results similar to the screen shots in your post, so I don't think they are what you are looking for.

The third one shows a variant layout made to fit right on a 10" scale 1 screen. It was probably the first and third screen shots you wanted yours to be like, but not the first and second.

The section Layout Variants on that Wiki page tells how to make those adjustments.
 
Upvote 0
Top