Giter Site home page Giter Site logo

android-multistatelistview's Introduction

Android - MultiStateListView

A simple Android ListView that lets you define three states:

  • Loading
  • Empty
  • Error

Screenshots

alt text  alt text  alt text  alt text

Usage

  • Define the MultiStateListView via XML (use custom attributes to reference the state layouts):
<com.jensdriller.libs.multistatelistview.MultiStateListView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        custom:emptyView="@layout/empty_view"
        custom:errorView="@layout/error_view"
        custom:loadingView="@layout/loading_view" />
  • Or build it via Java:
  MultiStateListView multiStateListView = new MultiStateListView.Builder(this)//
  .loadingView(R.layout.loading_view)//
  .emptyView(R.layout.empty_view)//
  .errorView(R.layout.error_view)//
  .build();
  • Show the desired state based on your logic:
  multiStateListView.showLoadingView();
  multiStateListView.showEmptyView();
  multiStateListView.showErrorView();

Example

Check out the sample project for an example implementation.

Download

Grab it via Gradle:

compile 'com.github.jenzz.multistatelistview:library:1.0'

or Maven:

<dependency>
  <groupId>com.github.jenzz.multistatelistview</groupId>
  <artifactId>library</artifactId>
  <version>1.0</version>
</dependency>

License

This project is licensed under the MIT License.

android-multistatelistview's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.