Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iammert/statusview
Custom status view for Android.
https://github.com/iammert/statusview
android custom-view statusview
Last synced: 21 days ago
JSON representation
Custom status view for Android.
- Host: GitHub
- URL: https://github.com/iammert/statusview
- Owner: iammert
- Created: 2017-01-26T15:01:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T06:41:54.000Z (over 6 years ago)
- Last Synced: 2024-08-03T01:26:18.771Z (4 months ago)
- Topics: android, custom-view, statusview
- Language: Java
- Size: 577 KB
- Stars: 780
- Watchers: 22
- Forks: 82
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StatusView
Custom status view for Android.# Usage
Add to XML
If you want to use ConnectionStatusView
```java```
If you want to use your own layout for status
```java```
Then call status method
```java
statusView.setStatus(Status.LOADING);
statusView.setStatus(Status.ERROR);
statusView.setStatus(Status.COMPLETE);
statusView.setStatus(Status.IDLE); //hide status
```If you want to dismiss automagically after oncomplete is called, then add ```app:dismissOnComplete="true"``` as attribute.
# Getters
You can inflate your custom views for all statuses(ERROR/COMPLETE/LOADING). And you can also get this views to control included UI widgets like button/imageview.
```java
View viewError = statusView.getErrorView();
View viewComplete = statusView.getCompleteView();
View viewLoading = statusView.getLoadingView();
```# Listeners
```java
statusView.setOnErrorClickListener(listener);
statusView.setOnLoadingClickListener(listener);
```# Import
Add this to you project build.gradle
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
Add this dependency to your app build.gradle```
compile 'com.github.iammert:StatusView:1.3'
```License
--------Copyright 2017 Mert Şimşek.
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 athttp://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.