alamkanak/android-empty-layout
소개
리스트 뷰가 비어 있을 때 다양한 레이아웃을 표시하는 라이브러리입니다.
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAndroid Empty Layout
Please note that this project is not being maintained now. Hopefully a new version will be available soon.
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

Usage
- Import the library project into your workspace.
- Use the imported project as a library for your project.
- In the
onCreateevent of your activity use the following code.
mListAdapter.clear();
EmptyLayout emptyLayout = new EmptyLayout(this, getListView());
- When you want to show the loading animation, use this code.
mListAdapter.clear();
emptyLayout.showLoading();
- When you want to show any error, use this code.
mListAdapter.clear();
emptyLayout.showError();
- When your list doesn't have any item to show, use this code.
mListAdapter.clear();
emptyLayout.showEmpty();
Thats all you have to do to use this library. You may want to customize its behavior though.
P.S. Make sure you always clear the list adapter before calling showEmpty, showLoading and showError. The list have to empty after all.
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
showEmptyshowLoadingshowErrorsetLoadingViewsetEmptyViewsetErrorViewsetLoadingAnimationsetErrorMessagesetLoadingMessagesetEmptyMessagesetEmptyViewButtonClickListenersetLoadingViewButtonClickListenersetErrorViewButtonClickListenersetShowEmptyButtonsetShowLoadingButtonsetShowErrorButton
and there is more...
Example
A simple example is also available.
License
Copyright 2014 Raquib-ul-Alam
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.
관련 프로젝트 살펴보기
불러오는 중…