Vacxe / PhoneMask

Android library for EditText. Easy way for add phone readability in your project.
Apache License 2.0
33 stars 4 forks source link

PhoneMask

PhoneMask is lightweight android library for EditText formatting. Easy way for add phone readability in your project.

Android Arsenal

How to use it

In Kotlin Just use PhoneMaskManager class

 PhoneMaskManager()
                .withMask(" (###) ###-##-##")
                .withRegion("+7")
                .withValueListener(object : ValueListener{
                    override fun onPhoneChanged(phone: String) {

                    }
                })
                .bindTo((findViewById(R.id.text_edit_text) as EditText))

You can also use this in Java,

 new PhoneMaskManager()
                .withMask(" (###) ###-##")
                .withRegion("+255")
                .bindTo((EditText)findViewById(R.id.text_edit_text))

About methods

Init methods

Get methods

Download

<dependency>
  <groupId>com.github.vacxe</groupId>
  <artifactId>phonemask</artifactId>
  <version>1.0.5</version>
  <type>pom</type>
</dependency>

or Gradle:


repositories {
    jcenter()
}

dependencies {
    compile 'com.github.vacxe:phonemask:1.0.5'
}