Chapter 4. Layout Patterns
In the previous chapters, we have looked at the most important patterns used for creating objects and at some of the most used material components. To bring these together, we need to consider the overall layouts an application might need. This allows us to plan our app in greater detail as well as introducing the interesting challenge of designing an app for different-sized screens and orientations. Android makes developing for a variety of screen sizes and shapes very simple and intuitive, and with a minimum of extra coding. We will then conclude by exploring and creating a strategy pattern.
In this chapter, you will learn how to:
- Use relative and linear layouts
- Apply gravity and weight
- Scale weights with weightSum
- Use the percent support library
- Develop layouts for specific screen sizes
- Create a strategy pattern
The Android platform provides a variety of layout classes. These range from the very simple frame layout to the quite complex layouts provided by...