Background Image when RecyclerView is empty

Do you know how to set a background image when the recycler view is empty? Like Gmail app... Question 2: is there a repository where I can find official images by Google for this purpose? EXAMPLE


Solution 1:

Yes, there is an official, Google maintained Github repository. Contains the latest version of their material icons, which are used on all Google apps.

Google's Material Design Icons Repository

And, regarding your first question: yes.

You can check if the adapter you are using to populate your RecyclerView is empty (or/and if the adapter has no items). If true, show the image, else, deal with the RecyclerView. Like this:

if (mAdapter.getItemCount() == 0) {
    // show my background image
    // do stuff
} else {
    // RecyclerView stuff
}