Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sw600dp quantifier not working on Galaxy Tab

Tags:

I have a program with 2 fragments. On tablets I am showing both of them.
I am doing this with /layout-sw600dp folder.
On Motorola Xoom and other tablets it is working but not in Samsung Galaxy Tab 10.1
This is very strange. I have searched everywhere and havent come accross with a person with the same problem?
What can be the reason?

like image 552
tasomaniac Avatar asked Jan 19 '12 12:01

tasomaniac


2 Answers

Might as well put this as an answer. The swXXXdp identifiers are only for Android 3.2 and above. If you want to make sure you properly target tablets both post- and pre-3.2, you must use the swXXXdp attribute and large/xlarge attributes. So for an example:

  • /layout/ -- for phone devices and portrait tablets
  • /layout-xlarge-land/ for landscape tablets pre-3.2
  • /layout-sw600dp-land/ for landscape tablets post-3.2

Before Honeycomb 3.2, Android used "size buckets" of small (e.g. Wildfire), normal (basically any phone), large (Streak 5, OG Galaxy Tab), xlarge (Xoom), but now ditches them in favour of these dp values which allow finer control.

like image 161
Alex Curran Avatar answered Sep 22 '22 20:09

Alex Curran


If you need support for 7 inch tables, then it is not xlarge but large: /layout/ -- for phone devices and portrait tablets /layout-large-land/ for landscape tablets pre-3.2 /layout-sw600dp-land/ for landscape tablets post-3.2

like image 44
TommyV Avatar answered Sep 24 '22 20:09

TommyV