Git Product home page Git Product logo

nointernetdialog's Introduction

No Internet Dialog

A beautiful Dialog which appears when you have lost your Internet connection.

Android Arsenal API

Setup

Gradle:

Add following line of code to your module(app) level gradle file

    implementation 'am.appwise.components:NoInternetDialog:1.1.3'

Maven:

  <dependency>
    <groupId>am.appwise.components</groupId>
    <artifactId>NoInternetDialog</artifactId>
    <version>1.1.3</version>
    <type>pom</type>
  </dependency>

Usage

Use simple builder to initiate the dialog. It will automatically appear if you'll lose your Internet connection, and dissapear, once it came back

  NoInternetDialog noInternetDialog = new NoInternetDialog.Builder(context).build();

or

  NoInternetDialog noInternetDialog = new NoInternetDialog.Builder(fragment).build();

and at the end

    @Override
    protected void onDestroy() {
        super.onDestroy();
        noInternetDialog.onDestroy();
    }

Customize the dialog with ease

  builder.setBgGradientStart() // Start color for background gradient
  builder.setBgGradientCenter() // Center color for background gradient
  builder.setBgGradientEnd() // End color for background gradient
  builder.setBgGradientOrientation() // Background gradient orientation (possible values see below)
  builder.setBgGradientType() // Type of background gradient (possible values see below)
  builder.setDialogRadius() // Set custom radius for background gradient
  builder.setTitleTypeface() // Set custom typeface for title text
  builder.setMessageTypeface() // Set custom typeface for message text
  builder.setButtonColor() // Set custom color for dialog buttons
  builder.setButtonTextColor() // Set custom text color for dialog buttons
  builder.setButtonIconsColor() // Set custom color for icons of dialog buttons
  builder.setWifiLoaderColor() // Set custom color for wifi loader
  builder.setConnectionCallback() // Set a Callback for network status
  builder.setCancelable(false) // Set cancelable status for dialog
alt text alt text
alt text alt text

This is work is is inspired from the work of Ramakrishna V. in Dribbble.

(https://dribbble.com/shots/2887886-No-internet-connection-GIF)

Versions

1.1.3

Connection callback status added Cancelable flag added

1.1.2

Receivers issue fixed

1.1.1

Vector drawable issue fixed for < API 21 UI issues fixed for small devices

1.1.0

New customization features added Issues fixed

1.0.1

Appear issue fixed

1.0.0

First version of library

Licence

    No Internet Dialog©
    Copyright 2017 Appwise
    Url: https://github.com/appwise-labs/NoInternetDialog

    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.

nointernetdialog's People

Contributors

robertlevonyan avatar

Watchers

 avatar  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.