Skip to content
Custom status view for Android.
Java
Branch: master
Clone or download
Latest commit e7ef5c2 Aug 10, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app - Fix custom layout problem Feb 13, 2017
art - Resized gif is added. Jan 26, 2017
gradle/wrapper initial commit Jan 26, 2017
library Update StatusView.java Aug 10, 2017
.gitignore .gitignore is updated Jan 26, 2017
README.md Update README.md Feb 13, 2017
build.gradle
gradle.properties initial commit Jan 26, 2017
gradlew initial commit Jan 26, 2017
gradlew.bat initial commit Jan 26, 2017
settings.gradle initial commit Jan 26, 2017

README.md

StatusView

Custom status view for Android.

Usage

Add to XML

If you want to use ConnectionStatusView

<iammert.com.library.ConnectionStatusView
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        app:dismissOnComplete="true" />

If you want to use your own layout for status

<iammert.com.library.StatusView
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        app:dismissOnComplete="true"
        app:complete="@layout/completeLayout"
        app:error="@layout/errorLayout"
        app:loading="@layout/loadingLayout"/>

Then call status method

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.

View viewError = statusView.getErrorView();
View viewComplete = statusView.getCompleteView();
View viewLoading = statusView.getLoadingView();

Listeners

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 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.
You can’t perform that action at this time.