• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to properly use layout-large and layout-land. Do I even need to use them?

RED_

Well-Known Member
Hey all, pretty basic question I presume but at the moment I have 5 layout folders. layout, layout-small, layout-normal, layout-medium and layout-large.

My app is heavily image based. As a result I have created the proper images. mdpi, hdpi and xhdpi. I don't think I need to worry about ldpi since screens are only getting bigger.

With this in mind and the need for me to now create a good landscape layout for all my pages, how do I go about this? Is it simple layout-land? No need for large/small/normal again right?

Considering that I've got all my hdpi and xdpi images do I even need layout-medium, layout-large and layout-normal? Because the images will be adjusting themselves based on screensize surely I can use one layout and have that work for all screens..?

It's all getting very confusing now that I'm trying to add a landscape view to my app. It doesn't do it very well at the moment so I will probably have to design a landscape friendly layout so I can understand that I would need to rebuild all my layouts for this particular use (We're talking about 100 layous here but oh well, I can manage it. :()
 
Is it intuitive to want to use the app in a landscape layout, portrait layout, or is it one that would be great either way? Some things just make more sense to be oriented Portrait and some moreso Landscape. Some it doesn't matter. If it makes more sense one way over another, then lock it to Portrait or Landscape only and be done with it.
 
That does sound very sensible. My app defintely is better viewed in potrait.. on a phone. I haven't got a tablet to test it on but I presume most people hold it in landscape mode so for a tablet it would probably be better to have it in landscape mode.

Is there a way to specify between tablet and phone?

It's a data based app, lots of data and it will be displayed in columns so you can understand how portrait is good for a phone. I guess it would be fine for a tablet too but wouldn't that limit usubility considering how most people use tablets?
 
In my opinion you should definitely have a layout and a layout-land implementation. Depending on your application, it may be also good to have layout-land-large. For example in a small to medium screen you are only have two columns, but in a large screen you have enough room for a third one. The third one could be a View that you normally show in a different Activity. You don't have to define all the set of layout-land-small, layout-land-medium and the like. The layout-land can be used as the default, which will handle all the cases, with the exception of layout-land-large, which will have a different treatment.

You also need to define different styles for large screens. Make all your widgets use a style and then create a values/styles.xml and a values-large/styles.xml. In large screens you should have bigger sizes and margins and of course bigger text. In many cases this will be enough and you won't need a different layout.

Don't make any assumptions on how the users use their phone and tablet. Some like holding it in landscape and some other in portrait mode. Also the distinction between phone and tablet is sometimes vague. Better to stick on screen sizes.
 
Also the distinction between phone and tablet is sometimes vague. Better to stick on screen sizes.

Very true. What is a Nexus 7 :) It's a tablet but the default layout orientation is like a phone. With the introduction of so many 7" tablets, most people use them in portrait layout because they are designed to be held like a book for reading purposes.

Check out my app. I use columns in it as well but it just made more sense to have it in portait mode because of the way it is used. It's an easy grader app so teachers will have it placed beside a stack of papers while grading, and with the amount of data displayed, it just made more sense to lock to portrait.

https://play.google.com/store/apps/details?id=teacherapps.easygrader.free&hl=en

I also see the other side of the argument though as not to make assumptions on how people use their phone/tablet. If you really want a properly displayed landscape layout, you definitely need to re-define the layouts specifically for landscape and in different sizes.
 
Thanks for the input lads.

I defintely have to adjust for text sizes which is why I have been creating layout-large & layout-xlarge etc. I have a lot of layouts and to change the text size I have to recreate each layout in the correct folders and change the text sizes. It's a right pain in the arse but I don't see another way around it.

I guess all in all I should give the user the option of a landscape mode but advise them with a little note that portrait mode is the best way to view this application. I agree that 7" tablets tend to be held like a book but then I do want to accomdate as many users as possible. 10.1" basically.

To be perfectly honest I have so many layouts that adjusting them all to have a landscape mode in both normal and large sizes would be one hell of a job. Seriously. I'm not sure it's something I'm prepared to do..

You know what, I might just stick to portait only but obviously implement layout-large and layout-xlarge to allow for the text sizes to be adjusted and overall look to fit screen sizes.
 
Back
Top Bottom