Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same layout for large and xlarge devices

My app has one layout for smartphone and one for tablets.

I want to use the same layout for both large and xlarge devices.

I want to support devices that use API 10 and up, so using sw<N>dp is out of the question.

How can I do that without putting the same xml file in both folders. I don't want to make code duplication. That's against any decent programming principles. :)

like image 648
Tudor Luca Avatar asked Apr 15 '13 19:04

Tudor Luca


1 Answers

I think that a xlarge device would use a "large" resource if there's no xlarge option in the application.

http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

So you can use only one XML to support either large or xlarge devices.

like image 138
Leaudro Avatar answered Oct 25 '22 04:10

Leaudro