Add Fragments (Standings and Single Team)

We want two new fragments to support what we’re doing with Navigation in this chapter: StandingsFragment and SingleTeamFragment. We’ll link to the StandingsFragment in the nav drawer and SingleTeamFragment as a separate (non-nav drawer) destination that we access from both StandingsFragment and TeamsFragment.

All the code you want to copy can be found in the chapter-9/code-to-copy directory.

Add StandingsFragment

The Standings page is going to be another RecyclerView list, but with a twist: we’re going to add some headers into the list to split up the rows. Specifically, we’re adding headers to split the East and West divisions of the ABL. The Standings page at the end will look like this:

Now, while ...

Get Kotlin and Android Development featuring Jetpack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.