Android library contain custom realisation of EditText component for masking and formatting input text

Overview

Masked-Edittext

Maven Central Android Arsenal Android Gems

Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality.

Image phone number formatted input

Image card number formatted input

Install

Maven

<dependency>
  <groupId>com.github.pinball83</groupId>
  <artifactId>masked-edittext</artifactId>
  <version>1.0.4</version>
  <type>aar</type>
</dependency>

Gradle

compile 'com.github.pinball83:masked-edittext:1.0.4'

Usage

Quick start

You can choose using this widget thought declaring it in layout resource xml

<com.github.pinball83.maskededittext.MaskedEditText
                android:id="@+id/masked_edit_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="number"
                app:mask="8 (***) *** **-**"
                app:notMaskedSymbol="*"
                app:maskIcon="@drawable/abc_ic_clear_mtrl_alpha"
                app:maskIconColor="@color/colorPrimary"
                />

or programmatically create in source file

MaskedEditText maskedEditText = new MaskedEditText.Builder(context)
            .mask("8 (***) *** **-**")
            .notMaskedSymbol("*")
            .icon(R.drawable.ic_account_circle)
            .iconCallback(unmaskedText -> { //Icon click callback handler })
            .build();

Attributes

MaskedEditText have following attributes

XML

...
app:mask = "8 (***) *** **-**"                     //mask
app:notMaskedSymbol = "*"                          //symbol for mapping allowed placeholders
app:replacementChar = "#"                          //symbol which will be replaced notMasked symbol e.g. 8 (***) *** **-** will be 8 (###) ### ##-## by default it assign to whitespace
app:deleteChar = "#"                               //symbol which will be replaced after deleting by default it assign to whitespace
app:format = "[1][2][3] [4][5][6]-[7][8]-[10][9]"  //set format of returned data input into MaskedEditText
app:maskIcon = "@drawable/abc_ic_clear_mtrl_alpha" //icon for additional functionality clean input or invoke additional screens
app:maskIconColor = "@color/colorPrimary"          //icon tint color
...

Java

Simple instance

MaskedEditText editText = new MaskedEditText.Builder(context)
            .mask("8 (***) *** **-**")
            .notMaskedSymbol("*")
            .build();; //set mask to "8 (***) *** **-**" and not masked symbol to "*"

Text setup and formatting

MaskedEditText editText = new MaskedEditText..Builder(context)
            .mask("8 (***) *** **-**")
            .notMaskedSymbol("*")
            .format("[1][2][3] [4][5][6]-[7][8]-[10][9]")//set format of returned data input into MaskedEditText
            .build();
editText.setMaskedText("5551235567");                     //set text into widget it will be look like 8 (555) 123 55-67

Invocation method getUnmaskedText() return 8 (555) 123 55-76 we swap to last digit

Widget instance with mask, icon button and callback

MaskedEditText editText = new MaskedEditText.Builder(context)
            .mask("8 (***) *** **-**")
            .notMaskedSymbol("*")
            .icon(R.drawable.ic_account_circle)
            .iconCallback(unmaskedText -> { //Icon click callback handler })
            .build();

Getting text

maskedEditText.getUnmaskedText() //return unmasked text
maskedEditText.getText()         //return mask and text
Comments
  • IndexOutOfBoundsException

    IndexOutOfBoundsException

    How to reproduce: type some input, bacskpace, type - backspace and so on. After couple of iterations there is a crash

    FATAL EXCEPTION: main Process: com.thrd.maskededitbox, PID: 11763 java.lang.IndexOutOfBoundsException: replace (15 ... 16) ends beyond length 15 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1090) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:498) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:492) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:491) at com.github.pinball83.maskededittext.MaskedEditText$MaskedInputFilter.filter(MaskedEditText.java:327) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:502) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:492) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:491) at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:121) at android.widget.TextView.doKeyDown(TextView.java:6095) at android.widget.TextView.onKeyDown(TextView.java:5908) at android.view.KeyEvent.dispatch(KeyEvent.java:2640) at android.view.View.dispatchKeyEvent(View.java:9240) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:379) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1640) at com.android.internal.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2395) at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1727) at android.app.Activity.dispatchKeyEvent(Activity.java:2731) at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50) at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:224) at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2310) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4127) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4089) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857) at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3434) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

    bug 
    opened by olegosipenko 13
  • how to hide text and show hint before we focus ..?

    how to hide text and show hint before we focus ..?

    I want to show hint in edit text and when user start to typing any thing then only masked characters are appear and if edittext is empty show the hint

    opened by Pareshoct7 5
  • [BUG] IndexOutOfBoundsException in replace

    [BUG] IndexOutOfBoundsException in replace

    Hi @pinball83

    I tried resolve this bugs, but I can't. Can you help me with this cases?

    I'm using this mask: whatever:mask="***.***.***-**" and whatever:notMaskedSymbol="*". Using the SwiftKey keyboard, when you hold backspace button, the EditText loses his mask. Using the SwiftKey keyboard again... when you tap on , character, the mask loses one char.

    Follow the stacktrace of the first crash(hold backspace button):

    java.lang.IndexOutOfBoundsException: replace (13 ... 14) ends beyond length 13
    at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1264)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:510)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
    at com.github.pinball83.maskededittext.MaskedMaterialEditText$MaskedInputFilter.filter(MaskedMaterialEditText.java:328)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:520)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:510)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
    at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:121)
    at android.widget.TextView.doKeyDown(TextView.java:6280)
    at android.widget.TextView.onKeyDown(TextView.java:6070)
    at android.view.KeyEvent.dispatch(KeyEvent.java:2675)
    at android.view.View.dispatchKeyEvent(View.java:9876)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:379)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.support.v4.view.ViewPager.dispatchKeyEvent(ViewPager.java:2652)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1667)
    at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:402)
    at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1787)
    at android.app.Activity.dispatchKeyEvent(Activity.java:3020)
    at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
    at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
    at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
    at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:316)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4297)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4268)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3872)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3838)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3965)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3846)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4022)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3872)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3838)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3846)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3819)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6180)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6154)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6115)
    at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3617)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    
    opened by jgabrielfreitas 4
  • Issue with masking and backspace

    Issue with masking and backspace

    Say you have something like 123-45-678. The dashes are the masked characters. If you delete until 123-45-6__ and then hit backspace again, your cursor will end up before the 2nd dash. If you try and type anything from that position, nothing will happen.

    bug 
    opened by zsperske 4
  • Reset a Masked-Edittext

    Reset a Masked-Edittext

    Hi dude, first say you thanks about your great work!.

    Second, i want to programmatically clear a Masked-Edittext, let me show you a example:

    maskedEditText1 = new MaskedEditText(this, "(**) **** - *****", "*", getResources().getDrawable(R.drawable.ic_account_circle), new MaskedEditText.MaskIconCallback() { @Override public void onIconPushed() { maskedEditText1.setText(""); System.out.println("Icon pushed"); } }); maskedEditText1.setInputType(InputType.TYPE_CLASS_NUMBER);

    But this give me a error when click in the button.

    Third question, i try to set a "Hint" but looks this not works, i wrong?

    Thank you very much!.

    opened by bsysop 3
  • Error when get focus

    Error when get focus

    I am getting the error below with the configuration as described

    <com.github.pinball83.maskededittext.MaskedEditText
                android:id="@+id/textPrecoReais"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBaseline="@+id/textViewRCifrao"
                android:layout_toRightOf="@id/textViewRCifrao"
                android:ems="5"
                android:selectAllOnFocus="true"
                android:digits="@string/localized_digitis"
                android:inputType="number"
                app:mask="***.***,**"
                app:notMaskedSymbol="*"
                />
    
    ```java
     Process: br.com.cacs, PID: 16922
     java.lang.IndexOutOfBoundsException: charAt: 0 >= length 0
         at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:114)
         at com.github.pinball83.maskededittext.MaskedEditText.getUnmaskedText(MaskedEditText.java:198)
         at com.github.pinball83.maskededittext.MaskedEditText.onTouch(MaskedEditText.java:290)
         at android.view.View.dispatchTouchEvent(View.java:7708)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2216)
         at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
         at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2329)
         at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1568)
         at android.app.Activity.dispatchTouchEvent(Activity.java:2458)
         at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:63)
         at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:63)
         at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2277)
         at android.view.View.dispatchPointerEvent(View.java:7893)
         at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3950)
         at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3829)
         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3395)
         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3445)
         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3414)
         at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3521)
         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3422)
         at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3578)
         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3395)
         at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3445)
         at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3414)
         at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3422)
         at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3395)
         at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5535)
        at android.view.ViewRootImpl.doProc
    
    opened by igorregis 2
  • EditText removes mask symbols if a user input non-digit symbols and then are crashed

    EditText removes mask symbols if a user input non-digit symbols and then are crashed

    On several devices the keyboard contains ',' '.' and '-' symbols even if I specify "number" input type.

    When I input this symbols then your EditText removes from mask one symbol. If I repeat this procedure then the EditText removes all symbols from mask and then crashes.

    There are my code example. I think that presence of "+7" is the root of problem:

           <com.github.pinball83.maskededittext.MaskedEditText
                    android:id="@+id/phone"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/prompt_phone"
                    android:inputType="phone"
                    android:maxLines="1"
                    android:singleLine="true"
                    app:mask="+7 (***) ***-**-**"
                    app:notMaskedSymbol="*"
                    app:maskIconColor="@color/colorPrimary"
                    />
    
    bug duplicate 
    opened by skatset 2
  • not working (1.0.3)

    not working (1.0.3)

    I install and copy-paste your "<com.github.pinball83.maskededittext.MaskedEditText android:id="@+id/masked_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number" app:mask="8 (**) *** -" app:notMaskedSymbol="" app:maskIcon="@drawable/abc_ic_clear_mtrl_alpha" app:maskIconColor="@color/colorPrimary" />" to the layout and it don't show mask in app. It's look like a simple EditText.

    opened by elronsmith 1
  • Add badge for android-gems.com

    Add badge for android-gems.com

    Added badge for android-gems: http://www.android-gems.com/lib/pinball83/Masked-Edittext , it looks like this:

    Android Gems

    [![Android Gems](http://www.android-gems.com/badge/pinball83/Masked-Edittext.svg?branch=master)](http://www.android-gems.com/lib/pinball83/Masked-Edittext)
    
    opened by liaohuqiu 1
  • Manifest Merger Failed

    Manifest Merger Failed

    Error:Execution failed for task ':main:MyApp:processProdDebugManifest'.

    Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:58:9-36 is also present at [com.github.pinball83:masked-edittext:1.0.2] AndroidManifest.xml:12:9-35 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:11:5-13:39 to override.

    You should probably not include this attribute.

    opened by zsperske 1
  • Crash when entering the wrong character

    Crash when entering the wrong character

        <com.github.pinball83.maskededittext.MaskedEditText
            android:id="@+id/inputNumber"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:digits="1234567890"
            android:imeOptions="actionDone"
            android:inputType="phone"
            android:maxLines="1"
            app:allowed_chars="0123456789"
            app:mask="+998 ** *** ** **"
            app:notMaskedSymbol="*" />
    
    java.lang.StringIndexOutOfBoundsException: length=19; index=27
            at java.lang.String.charAt(Native Method)
            at com.github.pinball83.maskededittext.MaskedEditText$MaskedInputFilter.filter(MaskedEditText.java:404)
            at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)
            at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:229)
            at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:36)
            at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:370)
            at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:71)
            at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:479)
            at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:148)
            at android.widget.TextView.doKeyDown(TextView.java:8700)
            at android.widget.TextView.onKeyDown(TextView.java:8470)
            at android.view.KeyEvent.dispatch(KeyEvent.java:3350)
            at android.view.View.dispatchKeyEvent(View.java:13304)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at androidx.core.widget.NestedScrollView.dispatchKeyEvent(NestedScrollView.java:622)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1912)
            at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:686)
            at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1869)
            at android.app.Dialog.dispatchKeyEvent(Dialog.java:968)
            at androidx.appcompat.app.AppCompatDialog.superDispatchKeyEvent(AppCompatDialog.java:208)
            at androidx.appcompat.app.AppCompatDialog$1.superDispatchKeyEvent(AppCompatDialog.java:48)
            at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
            at androidx.appcompat.app.AppCompatDialog.dispatchKeyEvent(AppCompatDialog.java:214)
            at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
            at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3068)
            at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:564)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6035)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5890)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5396)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5362)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5521)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5370)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5578)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5396)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5362)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5370)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5343)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8387)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8320)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8281)
            at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:4980)
            at android.os.Handler.dispatchMessage(Handler.java:106)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:6990)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
    
    opened by Sherzodbek-Muhammadiev 0
  • Manifest merger failed : App Name

    Manifest merger failed : App Name

    Manifest merger failed : Attribute application@label value=(Mystro N) from AndroidManifest.xml:32:9-33 is also present at [com.github.pinball83:masked-edittext:1.0.4] AndroidManifest.xml:12:9-41 value=(@string/app_name). Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:26:5-171:19 to override.

    Kindly take care of this.

    opened by nillbiplob 0
  • Can not use MaskedEditText with Text Input layout

    Can not use MaskedEditText with Text Input layout

    unable to perform operations with the text input layout, hint text is by default highlighted without selecting it , and i cant able to write anything inside edit text i e.masked edit text

    opened by sagarbandamwar 0
  • SetMaskedText is not displaying text

    SetMaskedText is not displaying text

    SetMaskedText is not displaying text when it does not have all the values ​​of the mask for example I have the following value 99 and the mask (##) #### - ####. Do you have any way to do it? I have now done the following

     @Override
       public void setMaskedText(String input) {
            int length = getTexto().length();
            String text = "";
          if (input.length() < length) {
              text = (new String(new char[length - input.length()]).replace("\0", " "));
           }
          super.setMaskedText(input + text);
       }
    
    
    public String getTexto() {
        return getText().toString().replaceAll("[^ a-z0-9]", "");
    }
    
    opened by jailson-developer 0
Owner
Evgeny Safronov
Evgeny Safronov
Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android

Chips EditText Library Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I deve

kpbird 381 Nov 20, 2022
User input masking library repo.

More GIFs [~3 MB] Migration Guide: v.6 This update brings breaking changes. Namely, the autocomplete flag is now a part of the CaretGravity enum, thus

red_mad_robot 1.2k Dec 20, 2022
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

Ali Muzaffar 439 Nov 29, 2022
Android form edit text is an extension of EditText that brings data validation facilities to the edittext.

Android Form EditText Android form edit text is an extension of EditText that brings data validation facilities to the edittext. Example App I built a

Andrea 1.5k Dec 14, 2022
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

Aditya Pradana Sugiarto 76 Nov 29, 2022
AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.

AutoscaleEditText AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size. Latest Version How to use

Txus Ballesteros 354 Nov 28, 2022
An Android App example of how to create a custom EditText using DoubleLinkedList Data Structure

DoubleLinkedListEditText Library This is a library to create an EditText based on the Doubly Linked List data structure so that the user can enter cod

Layon Martins 1 Nov 9, 2021
A custom EditText with a switchable icon which shows or hides the password

Deprecated This library is deprecated now as there is an official way to use the password toggle with the TextInputLayout (inside the support library

Maksim 430 Nov 20, 2022
An all-in-one Jetpack Compose component to handle text styling inside TextFields

An all-in-one Jetpack Compose component to handle text styling inside TextFields

Paweł Chochura 26 Dec 14, 2022
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
A editable text with a constant text/placeholder for Android.

ParkedTextView A EditText with a constant text in the end. How to use <com.goka.parkedtextview.ParkedTextView xmlns:app="http://schemas.android.co

goka 270 Nov 11, 2022
RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

mehran elyasi 4 Feb 14, 2022
A library to show emoji in TextView, EditText (like WhatsApp) for Android

Discontinued This projected is discontinued. Please consider using other alternative, i.e EmojiCompat. Contact me if you want to continue working on a

Hieu Rocker 3.6k Jan 5, 2023
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

Jan Heinrich Reimer 200 Nov 14, 2022
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

Jan Heinrich Reimer 200 Nov 14, 2022
A material style input for codes

Material Code input A material style input for put codes Based on Code input field concept by SAMUEL KANTALA How to use Minimal SDK Version 11 Usage w

Adrián Lomas 962 Nov 26, 2022
An extension of Android's TextView, EditText and Button that let's you use the font of your choice

AnyTextView (deprecated) Note: AnyTextView is no longer being maintained. I recommend replacing AnyTextView with the Calligraphy library instead. Frus

Hans Petter Eide 165 Nov 11, 2022
Android Custom View for prevent the view behind on-screen keyboard when edit text is focused

Group Focusable Prevent the view behind on-screen keyboard when edit text is focused in Android UI Download Gradle implementation 'com.akexorcist:grou

Akexorcist 8 Jun 22, 2022
A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.

CurrencyEditText CurrencyEditText is an extension of Android's EditText view object. It is a module designed to provide ease-of-use when using an Edit

Josh Kitchens 335 Dec 25, 2022