项目作者: HamidrezaAmz

项目描述 :
This is a custom view include: RecyclerView,Empty View, Loading View, Error View
高级语言: Java
项目地址: git://github.com/HamidrezaAmz/Rele.git
创建时间: 2018-11-13T12:43:54Z
项目社区:https://github.com/HamidrezaAmz/Rele

开源协议:

下载


API

Rele

error
empty
loading

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.

Getting Started

These instructions will help you to use this library inside your projects

Prerequisites

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

Installing

Step 1. Add the JitPack repository to your build file,
Add it in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Step 2. Add the dependency

  1. dependencies {
  2. implementation 'com.github.HamidrezaAmz:Rele:1.3.0'
  3. }

Here we go for implementation

Add xml of custom view into your parent view

  1. <com.vasl.recyclerlibrary.MyCustomView
  2. android:id="@+id/myCustomView"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent" ></com.vasl.recyclerlibrary.MyCustomView>

Refrence to custom-view inside your activity or fragment (I use butterknife)

  1. @BindView(R.id.myCustomView)
  2. MyCustomView myCustomView;

For getting recycler-view

  1. RecyclerView recyclerView = myCustomView.getRecyclerView();

For setting status

  1. myCustomView.setStatus(ListStatuse.LOADING);

List of statuses

  • ListStatus.LOADING
  • ListStatus.LOADING_BOTTOM
  • ListStatus.FAILURE
  • ListStatus.EMPTY
  • ListStatus.SUCCESS

Other Libraries

Author

  • Hamidreza amoozadeh - Android DEV - github

Supported Languages

  • English, Persian