All Projects → the-cybersapien → RecyclerELE

the-cybersapien / RecyclerELE

Licence: Apache-2.0 License
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RecyclerELE

Zoomrecylerlayout
🎢 Zoom Recycler Layout Manager For Android Kotlin
Stars: ✭ 618 (+2188.89%)
Mutual labels:  recyclerview, android-development, android-ui, recyclerview-adapter, androidstudio
Easyadapter
Recyclerview adapter library- Create adapter in just 3 lines of code
Stars: ✭ 122 (+351.85%)
Mutual labels:  recyclerview, android-development, android-ui, recyclerview-adapter
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+10744.44%)
Mutual labels:  recyclerview, android-development, android-ui, recyclerview-adapter
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+12907.41%)
Mutual labels:  recyclerview, android-development, android-ui, recyclerview-adapter
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-44.44%)
Mutual labels:  gradle, recyclerview, recyclerview-adapter
Drawer Behavior
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 394 (+1359.26%)
Mutual labels:  gradle, android-development, android-ui
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (+359.26%)
Mutual labels:  recyclerview, android-development, android-ui
kandy
Sweet Android libraries written in Kotlin
Stars: ✭ 19 (-29.63%)
Mutual labels:  recyclerview, recyclerview-adapter, recyclerview-multi-type
Recyclerview
How to use a recyclerview
Stars: ✭ 121 (+348.15%)
Mutual labels:  recyclerview, android-development, recyclerview-adapter
Anychart Android
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
Stars: ✭ 1,762 (+6425.93%)
Mutual labels:  gradle, android-development, android-ui
android-tableview-kotlin
Android's missing TableView component.
Stars: ✭ 40 (+48.15%)
Mutual labels:  recyclerview, android-development, android-ui
The Pit Of The Android Studio
👍 👍 👏 🌟 ⭐️ ⭐️ Everything about the Android Studio and Intellij IDEAfor example:Install,common problems and solutions,each libraries for android and androidx library,code and peoject templates,etc.全面总结Android Studio以及Intellij IDEA的填坑指南,详解AS版本号、Gradle版本、BuildTools三者的对照关系,AS模板配置,gradle插件,Android自带注解库详解,support详解等干货。
Stars: ✭ 296 (+996.3%)
Mutual labels:  gradle, android-development, androidstudio
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (+485.19%)
Mutual labels:  recyclerview, android-development, android-ui
AccordionRecycler
Android RecyclerView Adapter with nested items & expand/contract functionality
Stars: ✭ 17 (-37.04%)
Mutual labels:  recyclerview, recyclerview-adapter, recyclerview-multi-type
Statik
A simple static list information backed by RecyclerView for Android in Kotlin
Stars: ✭ 22 (-18.52%)
Mutual labels:  recyclerview, recyclerview-adapter, recyclerview-multi-type
Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (+722.22%)
Mutual labels:  gradle, android-development, android-ui
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+518.52%)
Mutual labels:  android-development, android-ui, androidstudio
AndroidBatteryStats
Displays all battery stats of an Android device using broadcast receiver.
Stars: ✭ 20 (-25.93%)
Mutual labels:  android-development, android-ui, androidstudio
Login-SignupUI-FirebasePhoneauth
New Repo
Stars: ✭ 43 (+59.26%)
Mutual labels:  android-development, android-ui, androidstudio
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+20392.59%)
Mutual labels:  recyclerview, android-development, android-ui

Recycler ELE


Release Download

Logo image

Related Blog Post: Cybersapien's blog

We often use the RecyclerView and the RecyclerView.Adapter for our material design apps. Going from the ListView to RecyclerView, I really missed the setEmptyView() method.

So, I extended the original RecyclerView Adapter to help manage different states in the application. The Adapter, apart from the standard list, supports three different views:

  • Loading View (While Data is being fetched)
  • Empty View (When there is not data)
  • Error View (In case of an error while fetching data)

This way, RecyclerELE helps us give different output to user depending on the current state of data, without having to mess a lot with the code.

Installation


The installation is pretty easy.

JCenter

For Gradle

In your app module's build.gradle add dependency:

    compile 'com.github.the-cybersapien:recyclerELE:(latest release)'
For Maven:

Add Snippet:

<dependency>
  <groupId>com.github.the-cybersapien</groupId>
  <artifactId>recyclerELE</artifactId>
  <version>v1.1</version>
  <type>pom</type>
</dependency>

Jitpack Gradle

In your project's build.gradle at the end of the repositories, add:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

In your app module's build.gradle add dependency:

    compile 'com.github.the-cybersapien:recyclerELE:(latest release)'

Usage


In your Activity, create a regular RecyclerView.Adapter for your List Item

    RecyclerAdapter listAdapter = new RecyclerAdapter(Object... args);

Get the reference to your RecyclerView

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);

Inflate your empty view, loading view and error view with the recyclerView as their parent programmatically.

    View loadingView = getLayoutInflator().inflate(R.layout.view_loading, recyclerView, false);
    View emptyView = getLayoutInflator().inflate(R.layout.view_empty, recyclerView, false);
    View errorView = getLayoutInflator().inflate(R.layout.view_error, recyclerView, false);

Initialize the RecyclerELEAdapter with the RecyclerAdapter and the different Views

    RecyclerELEAdapter recyclerELEAdapter = new RecyclerELE(listAdapter, emptyView, loadingView, errorView);

Set the RecyclerELEAdapter to your recyclerView

    recyclerView.setAdapter(recyclerELEAdapter);

Change the current View type of the adapter with setCurrentView() function

    // Normal List View
    recyclerELEAdapter.setCurrentView(RecyclerELEAdapter.VIEW_NORMAL);
    
    // Empty View
    recyclerELEAdapter.setCurrentView(RecyclerELEAdapter.VIEW_EMPTY);
    
    // Loading View
    recyclerELEAdapter.setCurrentView(RecyclerELEAdapter.VIEW_LOADING);
    
    // Error View
    recyclerELEAdapter.setCurrentView(RecyclerELEAdapter.VIEW_ERROR);

For more details, see the Sample Application in recyclerELE sample module.

License


Copyright [2017] [Aditya Aggarwal]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].