I would like to know what is the right way to implement a footer in RecyclerView which can be used to display different views. Few examples are as below
- View for network error with a button to reload.
- View when data is loading from server with a progress bar.
- View when there is no more data available.
- And so on.
I came across https://stackoverflow.com/a/29168617/371557 which mentions that I have to Override getItemViewType and inflate different views in onCreateViewHolder
What I do not understand is how will RecyclerView know which ViewType it has to request for? How can I force the RecyclerView to show the ViewType?