Building interfaces.
WHAT LAYOUT SYSTEMS EXIST
View-based layouts, defined in markup Declarative interfaces, defined in code
WHAT VIEW-BASED LAYOUTS USE
A hierarchy of containers and views.
WHAT TO PREFER FOR COMPLEX LAYOUTS
A constraint-based container, which produces flat hierarchies.
WHY FLAT
Deep hierarchies are measured repeatedly and cost performance.
WHAT RESOURCE QUALIFIERS DO
Provide alternatives selected automatically by device characteristics.
WHAT TO QUALIFY BY
Screen size and density Orientation Language Theme, for light and dark
WHAT TO PROVIDE FOR IMAGES
Several densities, or vector drawables where the artwork allows.
WHY VECTORS
One file scaling to every density, at a fraction of the size.
WHAT TO DEFINE CENTRALLY
Colours Dimensions and spacing Text styles
WHY
So the application is consistent and can be themed.
WHAT TO NEVER HARD-CODE
Text Colours Sizes
WHAT TO TEST
Every layout at the smallest screen, the largest, and the largest system font size.