Documente Academic
Documente Profesional
Documente Cultură
Matthew Gaunt
What Fragmentation?
Whats coming up
Design - I can haz pretty Dips Buckets? What buckets? The story of buckets Tips + Examples
Dips
Density Independent Pixels Abstract the screen size (think rounded corner rectangle) Never assume dip > pixels
Buckets?
ldpi
mdpi
hdpi
xhdpi
What Buckets?
Screen density (ldpi, mdpi, hdpi, xhdpi) Orientation (port, land) Android Version (v4, v11) Screen size (small, normal, large, xlarge)
[v4, v11]
The History...
The History...
<port> land
1.5
The History...
<port> land
1.5
The History...
<port> land
1.5
The History...
<port> land
1.5
xhdpi
4.0
Recap
Lots of buckets Lots of resources to apply the buckets to How it relates to other platforms like iOS
Random.
Phones / Tablets?
Small Normal Large XLarge ldpi mdpi hdpi xhdpi ldpi 1.7% 0.7% 0.2%
total hdpi xhdpi 2.4% 4.1% 18.5% 66.3% 2.5% 88.0% 2.8% 3.0% 4.9% 4.9%
mdpi
Phones
normal / small
Tablets
large / xlarge
Hitting Both?
drawable drawable-ldpi drawable-mdpi drawable-hdpi drawable-xhdpi drawable-large-? drawable-xlarge-? Additional Base For all buckets
values-land dimens.xml
<resources> <dimen name="default_text_size">15sp</dimen> <dimen name="default_large_text_size">25sp</dimen> <dimen name="splash_vertical_spacing">10dp</dimen> </resources>
values-v11 themes-v11.xml
<resources> <style name="Theme.FacebookSync.Support" parent="@android:style/Theme.Holo"></style> <style name="Theme.Dialog.Support" parent="@android:style/Theme.Holo.Dialog"></style> </resources>
values-v4 themes-v4.xml
<resources> <style name="Theme.FacebookSync.Support" parent="@android:style/Theme.NoTitleBar"></style> <style name="Theme.Dialog.Support" parent="@android:style/Theme.Dialog"></style> </resources>
Thanks :)
@gauntface matt@gauntface.co.uk