Thursday, April 18, 2013

Re: [android-developers] Re: Compatibility mode issues on 4.x

Ahh... he might have did it wrong, but that's an over simplification... I wish you could use the same layouts for those devices... fact is you cant.
DP and SP do an OK Job to fit each density, but not perfect. The same layout on the Galaxy Nexus and on the Nexus S look different enough to require modifications if you're pedantic enough or trying to fit a lot of views in.
It gets even worse when screen sizes change... thats why they added more modifiers (like screen sizes) to allow more control.

Heck, sometimes you'd want to use different layouts for the same screen sizes exactly because of the fact the sizes are the same - text that looks normal on xxhdpi looks huge on hdpi and text that looks normal on hdpi is tiny on xxhdpi.

btw - not to confuse anyone, but it's kinda misleading to say there's no correlation between screen density and screen size... Google tried to make it so you could program regardless of their values (they didnt succeed) but they are correlated (density is defined by screen size after all :-P).

On Thursday, April 18, 2013 2:58:26 PM UTC+3, Mark Murphy (a Commons Guy) wrote:
On Thu, Apr 18, 2013 at 3:53 AM, user123 <ivans...@gmail.com> wrote:
> I did the work to optimize layout for xhdpi devices

Then you did it wrong. Layouts should be density-independent. The
layout of an Xperia Z (xxhdpi) should be the same as a Galaxy Nexus
(xhdpi), which should be the same as a Nexus S (hdpi), etc., as they
are all the same basic screen size, within fractions of an inch.

Screen size != screen density. In fact, there is no correlation between the two.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.7 Available!

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment