Android-MultiStateListView

A simple Android ListView that lets you define three states: Loading, Empty & Error

License

License

GroupId

GroupId

com.github.jenzz.multistatelistview
ArtifactId

ArtifactId

library
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

aar
Description

Description

Android-MultiStateListView
A simple Android ListView that lets you define three states: Loading, Empty & Error
Project URL

Project URL

https://github.com/jenzz/Android-MultiStateListView
Source Code Management

Source Code Management

https://github.com/jenzz/Android-MultiStateListView

Download library

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jenzz.multistatelistview/library/ -->
<dependency>
    <groupId>com.github.jenzz.multistatelistview</groupId>
    <artifactId>library</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.jenzz.multistatelistview/library/
implementation 'com.github.jenzz.multistatelistview:library:1.0'
// https://jarcasting.com/artifacts/com.github.jenzz.multistatelistview/library/
implementation ("com.github.jenzz.multistatelistview:library:1.0")
'com.github.jenzz.multistatelistview:library:aar:1.0'
<dependency org="com.github.jenzz.multistatelistview" name="library" rev="1.0">
  <artifact name="library" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.jenzz.multistatelistview', module='library', version='1.0')
)
libraryDependencies += "com.github.jenzz.multistatelistview" % "library" % "1.0"
[com.github.jenzz.multistatelistview/library "1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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.

Versions

Version
1.0