• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

AndroidKeyboardWatcher

Software keyboard open/close watcher for Android.
Java
845
star
2

ConditionWatcher

Android tool which helps to synchronise application behaviours with test thread in automation tests.
Java
218
star
3

Review-Reporter

Bot for reporting Google Play Reviews on Slack with possibility to fast reply and creating Jira issues from low rating reviews.
Java
135
star
4

fastlane-plugin-automated-test-emulator-run

Plugin dedicated for Android platform. Wraps gradle task/shell command used for launching instrumented tests. Provides start of as many AVDs with various configs as needed before test run, waits for boot, kills emulators and deletes them from hdd after tests are finished or disturbed.
Ruby
112
star
5

apple-sign-in-php-sdk

PHP library to verify and validate Apple IdentityToken and authenticate a user with Apple ID.
PHP
89
star
6

Language-Switcher-Tile

An android plugin that allows you to easily change your device language.
Java
78
star
7

Api-Error-Handler

Declare expected errors of your API and generate implementing code automatically.
Java
67
star
8

AutomationTestSupervisor

Python tool for launching and managing Android Virtual Devices and Android Automation Tests. It provides elastic configurations, test and launch profiles, test video recording, html log generation and more.
Python
42
star
9

SMFloatingLabelTextField

A subclass of UITextField that displays floating placeholder
Swift
37
star
10

RxTesting

Application with examples of test cases for Android Rx code.
Java
31
star
11

WebViewTester

Android tool to automate interaction with web pages displayed in Android WebViews. Could be especially helpful in testing UI with Espresso.
Java
29
star
12

kafka-to-avro-writer

Kafka to Avro Writer based on Apache Beam. It's a generic solution that reads data from multiple kafka topics and stores it on in cloud storage in Avro format.
Java
25
star
13

scala-updatable-config

Library based on pure-config for getting updates from Consul or Vault backend.
Scala
23
star
14

CustomScrollActions

Sample project presenting how to deal with NestedScrollView in UiAutomation tests done with Espresso framework.
Java
18
star
15

AzimoTestKit

Supporting framework for writing unit tests in Swift
Swift
16
star
16

SMSecureTaskSwitcher

Use custom view for application preview in iOS Task Switcher
Objective-C
13
star
17

SimpleBDD

Simple library for tests in BDD style, written with Objective-C.
Objective-C
10
star
18

braze-templates-cli

Simple CLI tool written in Deno for creating a back-up of Braze templates and content blocks.
TypeScript
7
star
19

AzimoNote

Very simple small app that allows you to register users and store message notes bound to their profiles. Created in order to show how to setup AutomationTestSupervisor with real Android project.
Java
6
star
20

service-homescreen-aggregator

Based on our homescreen aggregator project we are showing examples for various implementation mechanisms like DynamoDB polymorphic model or rules engine etc.
Java
3
star
21

MobileInternshipTask

Programming task for mobile internship candidates
3
star
22

AppStoreConnectAPIClient

Swift
3
star
23

DecisionEngine

Example project showing basics behind our Decision Engine, built on top of Shapeless and Scala.
Scala
2
star
24

avro-rewriter

Reads, transforms and writes avro files written on Google Cloud Storage with use of Generic Avro Records.
Java
2
star
25

paloalto-gsuite

GlobalProtect authentication using SAML from G Suite
Shell
2
star
26

extend-camunda-dmn-juel-with-java-functions

This example contains ready to run Spring Boot application with Camunda where JUEL expression language is extended.
Java
1
star
27

daggerextensions

Java
1
star