May 2022
Intermediate to advanced
688 pages
20h 12m
English
In this chapter, you used the tools namespace to enable previews for the destinations in your navigation graph.
But the preview for CrimeListFragment might not look the way you would expect.
Each list item is a single, generic line of text, not the wonderful layout that you have built.
Thankfully, Android Studio also gives you tooling to preview the layout of a list item in a RecyclerView.
Open up fragment_crime_list.xml and use the tools:listitem attribute to help the preview use the right layout for each list item.
Listing 13.27 Providing previews for your list items (fragment_crime_list.xml)
<?xml version="1.0" encoding="utf-8"?> <androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" ...
Read now
Unlock full access