pinball83 / masked-edittext Goto Github PK
View Code? Open in Web Editor NEWAndroid library contain custom realisation of EditText component for masking and formatting input text
License: Apache License 2.0
Android library contain custom realisation of EditText component for masking and formatting input text
License: Apache License 2.0
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
Huawei Swype version 1.7.8.37560
Special characters includes Spaces, Asterisk,Minus, Plus....... etc. Results in app crash...
Hi,
Please provide the maskedText
property for supporting Android Data Binding. Currently setting android:text
causes exception.
When text is selected and deleted, the mask is altered/destroyed. This results in an out-of-bounds exception.
For example from my app:
<com.github.pinball83.maskededittext.MaskedEditText
android:id="@+id/met_series_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
app:mask="S: cccc N: cccccc"
app:notMaskedSymbol="c"
android:singleLine="true"
android:hint="@string/passport_field_number"/>
At runtime i can enter . , : spaces. And i can enter N, S symbols from keyboard at genymotion emulator runtime.
On rotation cursor jumps to the beginning
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"
/>
I'm using saripaar for validations but cant get error NotEmpty when field is not filled. There is a simple way to check this?
When I placed a bit long mask and set the EditText with multiline properties, it did not work.
Hint is not showing when edittext is empty (empty as user not entered anything)
<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)
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.
skipSymbolAfterDeletion get indexOutOfBoundsException after long backspace press
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]", "");
}
Hello,
How can I mask with below format ?
(XXX) XXX-XXXX ext.XXXXXX i.e (654) 321-5846 ext.654321
Thanks.
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.
Added badge for android-gems: http://www.android-gems.com/lib/pinball83/Masked-Edittext , it looks like this:
[![Android Gems](http://www.android-gems.com/badge/pinball83/Masked-Edittext.svg?branch=master)](http://www.android-gems.com/lib/pinball83/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!.
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)
I cant't set mask dynamically.
Setting mask in xml with app attributes works fine.
But defining edittext in xml and then setting mask through et.setMask("") doesnt work. Mask doesnt apepars.
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)
How can i achieve the following "file rename with extension masked" ?
Dears,
When I use MaskedEditText with TextInputLayout the place holder text not is possible, when start activity, the field show the mask, not label for this field.
Maybe update the code to extends for android.support.design.widget.TextInputEditText solve this.
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutPhoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/radioGroupGender"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<com.github.pinball83.maskededittext.MaskedEditText
android:id="@+id/maskedPhoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
app:mask="(**) *****-****"
app:notMaskedSymbol="*"
app:maskIconColor="@color/colorPrimary"
/>
</android.support.design.widget.TextInputLayout>
There is crash when there is MaskedEditText
in xml layout and Don't keep Activities is checked in Phone settings. When i move App to background and come back, it crashes. Log:
FATAL EXCEPTION: main
Process: com.pordiva.surat_kargo.debug, PID: 13257
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pordiva.surat_kargo.debug/com.pordiva.surat_kargo.ui.login.LoginActivity}: java.lang.IndexOutOfBoundsException: setSpan (5 ... 5) ends beyond length 0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.IndexOutOfBoundsException: setSpan (5 ... 5) ends beyond length 0
at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1094)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:669)
at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:662)
at android.text.Selection.setSelection(Selection.java:123)
at android.text.Selection.setSelection(Selection.java:134)
at android.widget.EditText.setSelection(EditText.java:128)
at com.github.pinball83.maskededittext.MaskedEditText$MaskedInputFilter.skipSymbol(MaskedEditText.java:365)
at com.github.pinball83.maskededittext.MaskedEditText$MaskedInputFilter.filter(MaskedEditText.java:340)
at android.widget.TextView.setText(TextView.java:4830)
at android.widget.TextView.setText(TextView.java:4796)
at android.widget.EditText.setText(EditText.java:114)
at android.widget.TextView.setText(TextView.java:4771)
at android.widget.TextView.onRestoreInstanceState(TextView.java:4664)
at android.view.View.dispatchRestoreInstanceState(View.java:16037)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3438)
at android.view.View.restoreHierarchyState(View.java:16015)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2329)
at android.app.Activity.onRestoreInstanceState(Activity.java:1164)
at android.app.Activity.performRestoreInstanceState(Activity.java:1109)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1191)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3226)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Current workaround: android:saveEnabled="false"
for MaskedEditText
java.lang.IndexOutOfBoundsException: charAt: 17 >= length 17
Cannot clear text programatically
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.
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
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.
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
RT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.