This is an attempt to make RecyclerView more easier to use. The custom Adapter implements loading view when loading data, error view when error occurs and load more view when having more data.
- Implement BaseViewAdapter and override onCreat**(exclueded onCreateViewHolder) function. Override useErrorHolder() (just return true)if you want a error view when error occurs. Override usePlaceholder() (just return true)if you want a placeholder when data is not prepared. And you can set view count by overriding getErrorHolderCount and getPlaceholderCount.
- Use a ListWrapper to load data.
- Set ListWrapper to your adapter.
- ListWrapper.load().
Data not prepared:
Loading failed:
Loading more failed:
See MainActivity.java