Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arierie/pageloader
Simple android library for loading page with easy customization
https://github.com/arierie/pageloader
Last synced: 3 months ago
JSON representation
Simple android library for loading page with easy customization
- Host: GitHub
- URL: https://github.com/arierie/pageloader
- Owner: arierie
- License: apache-2.0
- Created: 2016-11-23T13:25:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-03T10:03:13.000Z (about 3 years ago)
- Last Synced: 2024-05-22T06:11:01.935Z (6 months ago)
- Language: Java
- Homepage:
- Size: 694 KB
- Stars: 351
- Watchers: 8
- Forks: 45
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-github-android-ui - pageloader - 轻松自定义加载页面 (进度条)
README
# PageLoader
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PageLoader-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/4761)
PageLoader is a simple android library for loading page with easy customization. Built by [Arie Ridwansyah](https://github.com/arieridwan8).![PageLoader Demo](screenshots/demo.gif)
## Setup
Add __PageLoader__ to your dependencies block:
```groovy
dependencies {
implementation 'id.arieridwan:pageloader:0.0.2'
}
```
## Usage
### PageLoader
Add a `PageLoader` to your layout just like any other view.
```xml```
Define the action to load the page or displaying error page on the event
```java
SomeMethod(){
pageLoader.startProgress();
...
onComplete(){
...
}
onNext(){
...
pageLoader.stopProgress();
}
onError(){
...
pageLoader.stopProgressAndFailed();
}
}
```
Set onClickListener when error page is displayed
```java
pageLoader.setOnRetry(new View.OnClickListener() {
@Override
public void onClick(View view) {
pageLoader.startProgress();
}
});
```
You can easily customize the text for loading page or when displaying the error page then change the dimensions with following attribute
```xml
app:setLoadingText="Please wait..."
app:setErrorText="Something happened"
app:setTextColor="@color/black"
app:setTextSize="16sp"
```
Or you can change the image for loading or error page and set the dimensions of the image
```xml
app:setLoadingImage="@drawable/ic_search"
app:setErrorImage="@drawable/ic_not_found"
app:setLoadingImageHeight="64dp"
app:setLoadingImageWidth="64dp"
app:setErrorImageHeight="64dp"
app:setErrorImageWidth="64dp"
```
And also you can change the animation mode
```xml
app:setLoadingAnimationMode="rotate"
app:setLoadingAnimationMode="flip"
app:setLoadingAnimationMode="vibrate"
app:setLoadingAnimationMode="shake"
app:setLoadingAnimationMode="bounce"
```
And then, you can using custom animation or custom font
```java
pageLoader.setCustomAnimation(myAnimation);
pageLoader.setCustomFont(myTypeface);
```
## Screenshot
## To Do
- [ ] setDefaultFontEnabled
- [ ] setLoadingProgressModeEnabled## Credits
Arie Ridwansyah## License
PageLoader is under [Apache License 2.0](https://github.com/arieridwan8/pageloader/blob/master/LICENSE.txt).