Professional Documents
Culture Documents
In the class declaration above that, update the constructor to allow passing in a
ListSelectionRecyclerViewClickListener:
Open MainFragment.kt and update the class declaration to state that it conforms to
the ListSelectionRecyclerViewClickListener interface you just created:
Then, at the bottom of the class, implement the method to conform to the interface:
Now, whenever a tap happens on a list item in the recyclerView, the Fragment is
informed about it and calls clickListener.listItemTapped(), passing in the list
the user taps on. Now pass in our new
ListSelectionRecyclerViewClickListener() (MainFragment) to the adapter. Go
to onActivityCreated() and update the adapter creation to:
val recyclerViewAdapter =