GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AzimoLabs/MaskFormatter: Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

BranchesTags
Open more actions menu

Latest commit

 

History

37 Commits
37 Commits

Folders and files

NameName
Last commit message
Last commit date
art
art
 
 
gradle
gradle
 
 
maskformatter
maskformatter
 
 
sampleapp
sampleapp
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MaskFormatter

MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter

Animated

Mask should be built from characters listed below (java regex associated to character given after colon):

'9': '[0-9]',
'8': '[0-8]',
'7': '[0-7]',
'6': '[0-6]',
'5': '[0-5]',
'4': '[0-4]',
'3': '[0-3]',
'2': '[0-2]',
'1': '[0-1]',
'0': '[0]',

'*': '.',
'W': '\W',
'd': '\d',
'D': '\D',
's': '\s',
'S': '\S',

'A': '[A-Z]',
'a': '[a-z]',
'Z': '[A-ZÇÀÁÂÃÈÉÊẼÌÍÎĨÒÓÔÕÙÚÛŨ]',
'z': '[a-zçáàãâéèêẽíìĩîóòôõúùũüû]',
'@': '[a-zA-Z]',
'#': '[a-zA-ZçáàãâéèêẽíìĩîóòôõúùũüûÇÀÁÂÃÈÉÊẼÌÍÎĨÒÓÔÕÙÚÛŨ]',

'%': '[A-Z0-9]',
'w': '[a-zA-Z0-9]'

Usage

In your build.gradle:

dependencies {
    compile 'com.azimolabs.maskformatter:maskformatter:0.2'
}

Library is distributed via jCenter Maven repository. Make sure that you have it in your root gradle config:

allprojects {
    repositories {
        jcenter()
    }
}

Then you can use it like this:

public MainActivity extends Activity {

     private static final IBAN_MASK = "AA 99 9999 AAAA wwww wwww wwww";

     @Override
     public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.sample_layout);

          EditText ibanEditText = (EditText) findViewById(R.id.etIban);
          MaskFormatter ibanMaskFormatter = new MaskFormatter(IBAN_MASK, ibanEditText);
          ibanEditText.addTextChangedListener(ibanMaskFormatter);
     }

}

And make sure that you disabled suggestions from used EditText:

<EditText
    android:id="@+id/etIban"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="text|textNoSuggestions" />

License

	Copyright (C) 2016 AzimoLabs

    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.

Towards financial services available to all

We’re working throughout the company to create faster, cheaper, and more available financial services all over the world, and here are some of the techniques that we’re utilizing. There’s still a long way ahead of us, and if you’d like to be part of that journey, check out our careers page.

About

Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

Topics

androidhacktoberfest

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

158 stars

Watchers

7 watching

Forks

27 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.