7. Multiple xml layouts
Use multiple xml layouts for different screen
sizes
• layout
• layout-small
• layout-large
• layout-xlarge
8. Multiple xml layouts
Only do this when defining completely
different layouts
• Rearranging views on screen
• Adding views to screen
9. dimens.xml and
styles.xml
dimens.xml
• dp - density-independent pixels
• sp - scale-independent pixels
styles.xml
• properties such as padding, font size, font
style, background color, and much more
20. Conclusion
• Benefits of using dimens.xml and styles.xml
instead of multiple layout resources
• Smaller .apk sizes
• Easier to maintain
• Use multiple layout files only when creating
completely different layouts