This is a custom view include: Recycler-View, Empty-View, Loading-View, Error-View.
It can handle multiple UI states that we have on setting data into recycler-view in android. You just need to set state on this custom view.
These instructions will help you to use this library inside your projects
This library was built with androidX, so you should migrate into androidX to use this library with out any problem. For migration you can use Migrating to AndroidX
Step 1. Add the JitPack repository to your build file, Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.HamidrezaAmz:Rele:1.3.0'
}
Add xml of custom view into your parent view
<com.vasl.recyclerlibrary.MyCustomView
android:id="@+id/myCustomView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Refrence to custom-view inside your activity or fragment (I use butterknife)
@BindView(R.id.myCustomView)
MyCustomView myCustomView;
For getting recycler-view
RecyclerView recyclerView = myCustomView.getRecyclerView();
For setting status
myCustomView.setStatus(ListStatuse.LOADING);
List of statuses
- ListStatus.LOADING
- ListStatus.LOADING_BOTTOM
- ListStatus.FAILURE
- ListStatus.EMPTY
- ListStatus.SUCCESS
- Mkloader - The loading view library
- Hamidreza amoozadeh - Android DEV - github
- English, Persian