All Projects → steelkiwi → ErrorLayout

steelkiwi / ErrorLayout

Licence: other
Simple layout to show custom error toast with animation

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ErrorLayout

Bugsnag Go
Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
Stars: ✭ 155 (+1092.31%)
Mutual labels:  error-handling, error
Emperror
The Emperor takes care of all errors personally
Stars: ✭ 201 (+1446.15%)
Mutual labels:  error-handling, error
Graphql Errors
Simple error handler for GraphQL Ruby ❗️
Stars: ✭ 170 (+1207.69%)
Mutual labels:  error-handling, error
Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (+269.23%)
Mutual labels:  error-handling, error
koa-better-error-handler
A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)
Stars: ✭ 51 (+292.31%)
Mutual labels:  error-handling, error
Go Errortree
Go library for handling errors organized as a tree
Stars: ✭ 59 (+353.85%)
Mutual labels:  error-handling, error
Failure
failure is a utility package for handling application errors.
Stars: ✭ 187 (+1338.46%)
Mutual labels:  error-handling, error
Log Process Errors
Show some ❤️ to Node.js process errors
Stars: ✭ 424 (+3161.54%)
Mutual labels:  error-handling, error
TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
Stars: ✭ 26 (+100%)
Mutual labels:  error-handling, error
Flutter Layouts Exampls
Layout of the flutter example.such as Row,Comlun,listview,Just for learning.
Stars: ✭ 292 (+2146.15%)
Mutual labels:  layout, error
Make Error Cause
Make your own nested errors
Stars: ✭ 36 (+176.92%)
Mutual labels:  error-handling, error
failure
An error handling package for Go.
Stars: ✭ 24 (+84.62%)
Mutual labels:  error-handling, error
Thoth
An Error Logger for Go
Stars: ✭ 22 (+69.23%)
Mutual labels:  error-handling, error
Extensible Custom Error
JavaScript extensible custom error that can take a message and/or an Error object
Stars: ✭ 64 (+392.31%)
Mutual labels:  error-handling, error
Error Overlay Webpack Plugin
Catch errors with style 💥✨
Stars: ✭ 821 (+6215.38%)
Mutual labels:  error-handling, error
Swift Error Handler
Error handling library for Swift
Stars: ✭ 172 (+1223.08%)
Mutual labels:  error-handling, error
rust-error-handle
detail rust error handle
Stars: ✭ 47 (+261.54%)
Mutual labels:  error-handling, error
go-errors
Flexible, general-purpose error handling for Go.
Stars: ✭ 17 (+30.77%)
Mutual labels:  error-handling, error
Human Signals
Human-friendly process signals
Stars: ✭ 223 (+1615.38%)
Mutual labels:  error-handling, error
custom-exception-middleware
Middleware to catch custom or accidental exceptions
Stars: ✭ 30 (+130.77%)
Mutual labels:  error-handling, error

ErrorLayout

Simple layout to show custom error toast with animation

View

Toast will arise from bottom of screen to top

or top of screen to bottom

Download

Download via Gradle:

compile 'com.steelkiwi:error-layout:1.1.0'

Usage:

Add ErrorLayout to your xml layout

<steelkiwi.com.library.view.ErrorContainer
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

After that you need include your own layout with views. Than find our ErrorContainer view

ErrorContainer errorContainer = (ErrorContainer) findViewById(R.id.container);

Custom toast view configuration

ToastView toastView = new ToastView.Builder(this)
                .setTextSize(14)
                .setTextColor(Color.WHITE)
                .setTextGravity(Gravity.CENTER)
                .setAnimationType(AnimationType.TOP)
                .setShowDelay(2) // in seconds
                .setBackground(R.drawable.toast_background)
                .setUseActionBar(true) // if use action bar set true
                .build();

After that you need only set this toast to the ErrorContainer instance.

errorContainer.setToast(toastView);

And that it, now you can show this toast.

Show toast

loginButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String nameText = name.getText().toString();
                if(nameText.equals("")) {
                    errorContainer.showError(name, getString(R.string.empty_name_message));
                    return;
                }
        });

To show toast you need call method showError(View view, String message) and add parameters. View, where error happened and message. That all!!

License

Copyright © 2017 SteelKiwi, http://steelkiwi.com

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].