All Projects → egslava → Edittext Mask

egslava / Edittext Mask

Licence: mit
The custom masks for EditText. The solution for input phone numbers, SSN, and so on for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Edittext Mask

PhoneNumberKit
Android Kotlin library to parse and format international phone numbers. Country code picker.
Stars: ✭ 124 (-69.98%)
Mutual labels:  phone-number, mask
Maskara
A simple way to format text fields without getting affected by input filters
Stars: ✭ 515 (+24.7%)
Mutual labels:  edittext, mask
CHRTextFieldFormatter
Provides UITextField formatting masks. Such as phone number and credit card number formatters.
Stars: ✭ 52 (-87.41%)
Mutual labels:  phone-number, mask
Maskededittext
It allows you to add a mask to EditText
Stars: ✭ 184 (-55.45%)
Mutual labels:  phone-number, mask
CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-93.7%)
Mutual labels:  android-sdk, edittext
Kotlin Android Boilerplate
Kotlin Android boilerplate project with MVVM architecture using RxJava, Dagger 2, and more!
Stars: ✭ 278 (-32.69%)
Mutual labels:  android-sdk
Rdvideoeditsdk For Android
Android Video Editing SDK; Android Video Edit SDK: Video Cut, Video Join, Video Watermark, Video Subtitle, Video Rotate...
Stars: ✭ 343 (-16.95%)
Mutual labels:  android-sdk
Fuzzing Imagemagick
OpenSource My ImageMagick Fuzzer ..
Stars: ✭ 270 (-34.62%)
Mutual labels:  mask
Androidsvgdrawable Plugin
Gradle plugin that generates qualified, density specific PNG drawables from SVG files at build time for your Android projects.
Stars: ✭ 263 (-36.32%)
Mutual labels:  android-sdk
Libphonenumber Csharp
Offical C# port of https://github.com/googlei18n/libphonenumber
Stars: ✭ 396 (-4.12%)
Mutual labels:  phone-number
Wedatasphere
WeDataSphere is a financial level one-stop open-source suitcase for big data platforms. Currently the source code of Scriptis and Linkis has already been released to the open-source community. WeDataSphere, Big Data Made Easy!
Stars: ✭ 372 (-9.93%)
Mutual labels:  mask
Autocomplete
Simple yet powerful autocomplete behavior for EditTexts, to avoid working with MultiAutoCompleteTextView APIs.
Stars: ✭ 307 (-25.67%)
Mutual labels:  edittext
Awesome Falsehood
😱 Falsehoods Programmers Believe in
Stars: ✭ 16,614 (+3922.76%)
Mutual labels:  phone-number
Androidproject
Android 技术中台,但愿人长久,搬砖不再有
Stars: ✭ 4,398 (+964.89%)
Mutual labels:  android-sdk
Bankcardformat
💳 自动格式化银行卡号的EditText,卡号格式化、归属银行及卡别判断
Stars: ✭ 273 (-33.9%)
Mutual labels:  edittext
Libphonenumber For Php
PHP version of Google's phone number handling library
Stars: ✭ 3,938 (+853.51%)
Mutual labels:  phone-number
Shapeofview
Give a custom shape to any android view, Material Design 2 ready
Stars: ✭ 2,977 (+620.82%)
Mutual labels:  mask
Togetherad
🔥持续更新。Android广告聚合:帮助 Android 开发者快速、便捷、灵活的接入国内多家主流安卓广告 SDK。广点通(优量汇)、穿山甲、百青藤(百度Mob)。开屏广告、Banner横幅广告、插屏广告、激励广告、原生信息流、全屏广告。
Stars: ✭ 305 (-26.15%)
Mutual labels:  android-sdk
Awesome Phonenumber
Google's libphonenumber pre-compiled with the closure compiler
Stars: ✭ 357 (-13.56%)
Mutual labels:  phone-number
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (-28.33%)
Mutual labels:  phone-number

MaskedEditText

Download Build Status

MaskedEditText - the library for masked input of phone numbers, social security numbers and so on for Android

This project derives from toshikurauchi/MaskedEditText, but it's been adapted for gradle build system and has additional features:

  1. filter allowed chars
  2. filter denied chars
  3. user can use chars from mask in his input (in original version of this library user couldn't use digit '7' in the '+7(XXX)XXX-XX-XX' pattern).
  4. You can keep hints even when user started typing.

So it allows you to use masks for phones, urls, etc.

Enjoy!

Get it on Google Play


en_US

MaskedEditText is a simple Android EditText with customizable input mask support.

For instance, you need user specified his phone in format +7(XXX)XXX-XX-XX. You also know user should have the only possibility to write digits but minuses, brackets and "+7" should appear automatically.

Usage

Add this to your build.gradle :

compile 'ru.egslava:MaskedEditText:1.0.5'

Or download project and plug it in as a library.

Add xmlns:mask="http://schemas.android.com/apk/res-auto" to your layout xml root:

  <br.com.sapereaude.maskedEditText.MaskedEditText
    android:id="@+id/phone_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="phone"
    android:typeface="monospace"
    mask:allowed_chars="1234567890"
    mask:mask="+7(###)###-##-##"
    android:hint="1234567890"
    app:keep_hint="true"
    />    

Where mask is the input mask you want and '#' is an editable position (will be replaced by a whitespace on screen).

You can optionally set the representation character (in case you don't want to use '#'):

<br.com.sapereaude.maskedEditText.MaskedEditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    mask:mask="ccc.ccc.ccc-cc"
    mask:char_representation="c"
/>

You can also change the mask and the representation character programatically:

MaskedEditText editText = (MaskedEditText) findViewById(R.id.my_edit_text)
// Setting the representation character to '$'
editText.setCharRepresentation('$');
// Logging the representation character
Log.i("Representation character", editText.getCharRepresentation());
// Setting the mask
editText.setMask("##/##/####");
// Logging the mask
Log.i("Mask", editText.getMask());

To enable Enter softkey action (IME action):

<br.com.sapereaude.maskedEditText.MaskedEditText
    ...
    mask:enable_ime_action="true"
    ...
/>

Or programmatically:

MaskedEditText editText = (MaskedEditText) findViewById(R.id.my_edit_text)
editText.setImeActionEnabled(true);

ru_RU

MaskedEditText - это всего лишь EditText, но с возможностью задавать произвольную маску.

Например, нужно ввести телефон в формате +7(XXX)XXX-XX-XX. Причём можно ввести только цифры, а скобочки, дефисы и "+7" должны подставляться самостоятельно.

Использование

Вписать в build.gradle:

compile 'ru.egslava:MaskedEditText:1.0.5'

или скачать проект и подключить как библиотеку.

Добавить xmlns:mask="http://schemas.android.com/apk/res-auto" в корневой элемент файла разметки:

  <br.com.sapereaude.maskedEditText.MaskedEditText
    android:id="@+id/phone_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="phone"
    android:typeface="monospace"
    mask:allowed_chars="1234567890"
    mask:mask="+7(###)###-##-##"
    android:hint="1234567890"
    app:keep_hint="true"
    />

mask задаёт требуемую маску, символ '#' задаёт редактируемую позицию (и будет заменён на пробел на экране).

Если использовать '#' нельзя, то можно попробовать использовать другой символ:

<br.com.sapereaude.maskedEditText.MaskedEditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    mask:mask="ccc.ccc.ccc-cc"
    mask:char_representation="c"
/>

Кроме того, всё тоже самое можно сделать и программно:

MaskedEditText editText = (MaskedEditText) findViewById(R.id.my_edit_text)
// Setting the representation character to '$'
editText.setCharRepresentation('$');
// Logging the representation character
Log.i("Representation character", editText.getCharRepresentation());
// Setting the mask
editText.setMask("##/##/####");
// Logging the mask
Log.i("Mask", editText.getMask());

Чтобы включить обработку нажатия Enter (IME action):

<br.com.sapereaude.maskedEditText.MaskedEditText
    ...
    mask:enable_ime_action="true"
    ...
/>

Или программно:

MaskedEditText editText = (MaskedEditText) findViewById(R.id.my_edit_text)
editText.setImeActionEnabled(true);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].