Chapter 6. Activating Patterns
The chapters up to this point have served as an extended introduction, exploring the practicalities of Android development and the theory of design pattern application. We have covered many of the fundamental components of an Android app and seen how some of the most useful patterns are made, but we have not yet put the two together.
In this chapter, we will build one of the main sections of our app, an ingredient selection menu. This will involve a scrollable list of fillings that can be selected, expanded, and dismissed. On the way, we will also take a look at the collapsible toolbar and one or two other handy support library features, adding functionality to action buttons, a floating action button, and an alert dialog.
At the heart of this code, we will apply a simple factory pattern to create each ingredient. This will demonstrate nicely how this pattern hides creational logic from client classes. In this chapter, we will create only a single...