MCPcopy Index your code
hub / github.com/alamkanak/android-empty-layout

github.com/alamkanak/android-empty-layout @android-empty-layout-v1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release android-empty-layout-v1.1 ↗ · + Follow
59 symbols 84 edges 2 files 46 documented · 78%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android Empty Layout

A library for showing different types of layouts when a list view is empty. These layouts can be shown when, * the list is loading * the list has no item to display * an error occured trying to load items

Loading animation is also supported.

Screenshots

alt text alt text alt text alt text

Usage

  1. Import the library project into your workspace.
  2. Use the imported project as a library for your project.
  3. In the onCreate event of your activity use the following code.

java EmptyLayout emptyLayout = new EmptyLayout(this, getListView()); 4. When you want to show the loading animation, use this code.

java emptyLayout.showLoading(); 5. When you want to show any error, use this code.

java emptyLayout.showError(); 6. When your list doesn't have any item to show, use this code.

java emptyLayout.showEmpty(); Thats all you have to do to use this library. You may want to customize its behavior though.

Customization

There are bunch of methods to let you customize this pattern. Use the methods like this.

emptyLayout.setLoadingMessage("Please wait...");

Some useful methods are given below * showEmpty * showLoading * showError * setLoadingView * setEmptyView * setErrorView * setLoadingAnimation * setErrorMessage * setLoadingMessage * setEmptyMessage * setEmptyViewButtonClickListener * setLoadingViewButtonClickListener * setErrorViewButtonClickListener * setShowEmptyButton * setShowLoadingButton * setShowErrorButton

and there is more...

Example

A simple example is also available.

Core symbols most depended-on inside this repo

changeEmptyType
called by 4
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
populateList
called by 2
EmptyLayoutSample/src/com/kanak/emptylayoutsample/MainActivity.java
setEmptyView
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
getListView
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
setErrorButtonClickListener
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
refreshMessages
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
setDefaultValues
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java
getRotateAnimation
called by 1
EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java

Shape

Method 57
Class 2

Languages

Java100%

Modules by API surface

EmptyLayout/src/com/kanak/emptylayout/EmptyLayout.java51 symbols
EmptyLayoutSample/src/com/kanak/emptylayoutsample/MainActivity.java8 symbols

For agents

$ claude mcp add android-empty-layout \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page