Giter Site home page Giter Site logo

androidcustomedittext's Introduction

AndroidCustomEditText

	repositories {
	
		maven { url 'https://jitpack.io' }
		
	}
                dependencies {
	        implementation 'com.github.mrmkh:AndroidCustomEditText:1.0.2'
	}

Alt text

        <custom.edittext.lib.Username
        android:id="@+id/user"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <custom.edittext.lib.Password
        android:id="@+id/pass"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <custom.edittext.lib.EmailAddress
        android:id="@+id/email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <custom.edittext.lib.PhoneNumber
        android:id="@+id/phone"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>


    <custom.edittext.lib.CustomEditText
        android:id="@+id/text"
        app:hintText="Custom Iconic EditText"
        app:set_text=""
        app:input_type="textEmailAddress"
        app:hintIcon="@drawable/search_24dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

Usage

 private void phoneNum() {
//        Toast.makeText(this, phone.getCountryCode()+" "+phone.getText(), Toast.LENGTH_SHORT).show();
             test1.setText(phone.getCountryCode()+" "+phone.getText());
    }

    private void emailValid() {
        boolean mailValid = email.isValid(EmailAddress.ValidationType.EMAIL);
            if (mailValid == true){
                Toast.makeText(this, "true", Toast.LENGTH_SHORT).show();
            }
            else if (mailValid==false){
                email.setError("Email is invalid");
            }
    }

    private void passwordValid() {
        boolean passValid = pass.isValid(Password.ValidationType.PASSWORD);

        if (passValid==true){
            Toast.makeText(this, "True", Toast.LENGTH_SHORT).show();
        } else if (passValid==false){
            pass.setError("8 characters long\ninclude at least one number and symbol\n1 uppercase & 1 lowercase character");
        }
    }

    private void usernameValid() {
        boolean userValid = user.isValid(Username.ValidationType.USERNAME);
        if (userValid==true){
            Toast.makeText(this, "True", Toast.LENGTH_SHORT).show();
        } else {
            user.setError("Please use only letters (a-z) , numbers and Underline");
            //4-32 character
        }
    }

License

MIT

androidcustomedittext's People

Stargazers

 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.