Adding the label to the UI

The first step is to update the UI so that we have a TextView to display the amount of results. Let's go to activity_search.xml and add the following element searchButton:

<Button android:id="@+id/searchButton" ... />

<TextView android:id="@+id/results"
app:layout_constraintTop_toBottomOf="@id/searchText"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<android.support.v7.widget.RecyclerView ... />

Then, we need to update the RecyclerView so that it appears below the newly created results:

<android.support.v7.widget.RecyclerView
android:id="@+id/articles"
android:scrollbars="vertical"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/results" />
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.104.183