Git Product home page Git Product logo

errorview's Introduction

Android Arsenal

ErrorView

A custom view that displays an error image, a title, and a subtitle given an HTTP status code. It can be used for various other purposes like displaying other kinds of errors, or just messages with images.

#Usage ###Add as a dependency

    compile 'com.github.xiprox.errorview:library:2.0.0'

###Set the error by HTTP Status Code You just need to pass your HTTP status code using setError(int) and ErrorView will show the associated error description for you.

###Set the error manually In order to set the title or the subtitle manually, you can make use of the setTitle(String), setTitle(int), setSubtitle(String), and setSubtitle(int) methods.

###Catch Retry Events To catch retry events, you can make use of the setOnRetryListener(RetryListener) method.

###More Methods Check out the source code for other methods and their explanations.

###XML Attributes

<tr.xip.errorview.ErrorView xmlns:errorview="http://schemas.android.com/apk/res-auto"
    android:id="@+id/error_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    errorview:ev_title="@string/..."
    errorview:ev_titleColor="@color/..."
    errorview:ev_subtitle="@string/..."
    errorview:ev_subtitleColor="@color/..."
    errorview:ev_errorImage="@drawable/..."
    errorview:ev_showTitle="boolean"
    errorview:ev_showSubtitle="boolean"
    errorview:ev_showRetryButton="boolean"
    errorview:ev_retryButtonText="@string/..."
    errorview:ev_retryButtonBackground="@drawable/..."
    errorview:ev_retryButtonTextColor="@color/..." />

#Sample App Get it on Google Play

#Apps using ErrorView Check out this wiki page for the list of apps using ErrorView. If you are using ErrorView in your app, please take a moment to add your app to the list. I really appreciate it.

#License

Copyright (C) 2015 Ihsan Isik

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.

errorview's People

Contributors

xiprox avatar taylorsloan avatar

Watchers

尚晓东 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.