Chapter 2 Build Views with Fragments
Kotlin and Android Development featuring Jetpack — by Michael Fazio (17 / 125)
👈 Summary and Next Steps | TOC | Build a Fragment (Pick Players) 👉
In the last chapter, we got ourselves a working app with a base navigation setup. Plus we created the skeletons of two views, PickPlayersFragment and GameFragment. We’ll build out both Fragment classes in this chapter, starting with PickPlayersFragment to teach you the concepts. Once that Fragment is ready, we’ll go through a similar process with GameFragment but in quicker fashion. At the end of the chapter, PickPlayersFragment and GameFragment will look something like this:
We’re going to start in fragment_pick_players.xml with the <ConstraintLayout> that’ll be the core of our view, then add in the floating action button (FAB) that’ll eventually start our game.
👈 Summary and Next Steps | TOC | Build a Fragment (Pick Players) 👉
Kotlin and Android Development featuring Jetpack by Michael Fazio can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.