3

The question is how create a specific layout for Nexus 4 and similar devices?

4.7" diagonal 1280 x 768 pixel resolution (320 ppi) WXGA IPS

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Zeus Monolitics
  • 832
  • 9
  • 19
  • read here http://developer.android.com/guide/practices/screens_support.html – Tomer Mor Feb 26 '13 at 22:40
  • Yes. The idea is not build a specific for Nexus 4, but for similar devices resolutions and inchs. What is the right layout folder layout-sw***dp?. I am going to change the title. – Zeus Monolitics Feb 27 '13 at 09:48
  • @kcoppock I think it's not as unreasonable as it seems. For instance, the Nexus 7 tends to get a "phonish" layout instead of a "tabletty" layout if you rely on the default device config buckets. Putting a tabletty layout in that particular bucket ruins the experience on older 7" tablets with much lower resolution. The Nexus 4 is in a similar spot compared to older phones. – Barend Feb 27 '13 at 09:53
  • @Barend If you use `sw600dp`, the Nexus 7 will pull from that. If you're still using the old `large` and `xlarge` differentiators it may not. @ZeusMonolitics what *exact* problem are you trying to target? – Kevin Coppock Feb 27 '13 at 17:34
  • @kcoppock I know, but from your comment there was no way for me to tell that you did too :-). – Barend Feb 27 '13 at 18:00

2 Answers2

3

For Nexus 4 should load the same layout that Galaxy S3

Galaxy S3 Screen Size: 4.8 inch Screen Resolution: 1,280 x 720 pixels

And the configuration should be:

  1. For same layout landscape and portrait layout-sw360dp
  2. Only for landscape layout-sw360dp-land
  3. Only for portrait layout-sw360dp-port

Other similar devices:

  • LG Optimus 4X HD
  • HTC One X+

For Galaxy S4 should also compatible and load this layout

The response was in this entry: Android S3 layout vs Galaxy Nexus layout

Community
  • 1
  • 1
Zeus Monolitics
  • 832
  • 9
  • 19
2

You can create layout directories for specific combinations. For 7" 1280 x 768 at 320 ppi it will look something like this:

layout-sw600p-xdpi-large

As @Tomer Mor mentioned, you can find a full list of available parameters here

Also, if you want to be even more specific about device parameters, take a look at this question - you can assign different layouts from code, depending on the environment.

Community
  • 1
  • 1
Anton Cherkashyn
  • 5,719
  • 6
  • 43
  • 80