Giter Club home page Giter Club logo

validutil's Introduction

A utility library that does the following things:

  • Check internet connection
  • Validate for empty edit texts
  • Validate for email
  • Validate for mobile number
  • Validate text for any no of digits
  • Fancy Progress Dialog

Watch it in action here

How to add

Add this in the project level build.gradle:

             repositories{
                  ....
                  maven { url 'https://jitpack.io' }
             }

And this in the app level build.gradle

compile 'com.github.shree-vastava:ValidUtil:v1.0'

How to use

Create an object of the ValidUtils class

    ValidUtils validUtils = new ValidUtils() 

Check for internet connection

    if (validUtils.isNetworkAvailable(this)){
        // do whatever you want to do IF internet is AVAILABLE
    }

Check for empty EditTexts

    if(validUtils.validateEditTexts(name,mobile,email)){ //where name,mobile, email are EditTexts
        // do whatever you want to do if EditTexts are not empty
    }

Check for Email validation

    if(validUtils.validateEmail(email)){
         // do whatever you want to do if email is valid i.e in form of [email protected]
    }

You can check for more email EditTexts also by passing comma separate EditTexts in the above function

Check for mobile Number

    if(validUtils.validateMobileNumber(mobile)){
         // do whatever you want to do if mobile number is valid i.e 10 digits
    }

You can check for multiple mobile EditTexts

Check for no of digits in an EditText

    if(validUtils.validateForDigits(Pin,6)){
         // do whatever you want to do if Pin is 6 digits
    }

Here Pin the EditText

Show and hide Fancy Progress Dialog

   validUtils.showProgresDialog(this,this)

where the arguements are like

   validUtils.showProgressDialog(Context, Activity)

To hide the dialog

   validUtils.hideProgressDialog()

The last and simplest as well as bonus functionality

The Toast

  validUtils.showToast(Context,"some message")

validutil's People

Contributors

shree-vastava avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

validutil's Issues

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.