Giter VIP home page Giter VIP logo

maskara's People

Contributors

danielbenedykt avatar santalu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maskara's Issues

Widget makes the app crash if used without a mask

Hi @santalu!

The widget makes the app crash if it is used without a mask. It is becasue a null listener is added on the overriden function onAttachedToWindow

I have replaced line 65 of MaskEditText.kt with the following validation to fix the issue

if(maskChangedListener != null) {
addTextChangedListener(maskChangedListener)
}

Good library!!

Thank you!

Cesar.-

Problem with change textColor

I am trying to change the color of the text with "android:textColor".
But for some reason, the color remains "colorPrimary" from the library.

Does this library have the ability to change the color of the text?

Thank you in advance)

Format gets duplicated when deleting

Using the following code and format

<com.google.android.material.textfield.TextInputLayout
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:layout_margin="@dimen/material_margin"
                        android:hint="@string/phone">

                    <com.santalu.maskedittext.MaskEditText
                            android:id="@+id/PhoneTextInput"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:inputType="phone"
                            app:met_mask="###-###-####x######"/>

                </com.google.android.material.textfield.TextInputLayout>

</com.google.android.material.textfield.TextInputLayout>

When placing your cursor before the 'x' (for extension) and deleting a number creates duplicate 'x' characters.

image

Input duplication on Android 7.1.1 (API 25)

Hey. Just to let you know, I'm not sure if this is some weird interaction between your lib and android 7.1.1, but for some reason, the input is getting duplicated sometimes. Example bellow:

Mask: ##:##:##:##:##:##
inputType: textCapCharacters
Scenario: try typing ABCDEFGHIL on a software keyboard (it works fine with a hardware keyboard).

You'll see the following result "AB:CD:CD:...". It duplicates the "CD" right after you type "D". This happens with other strings as well.

Adding the input type as "textCapCharacters | textNoSuggestions" fixes the issue.

IP Mask

How to use it for : IP Mask

example :
192.168.0.1
198.168.127.250

every part : 0..255

also with hint like :
input ip : xxx.xxx.xxx.xxx

Android Manifest Error After adding this dependency.

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
	is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-30:19 to override.

capture

Format gets duplicated when deleting

Hello, Dear Developer.
Using the following code and format

<com.santalu.maskedittext.MaskEditText
android:id="@+id/maskEditText"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="21dp"
android:layout_marginLeft="21dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="21dp"
android:layout_marginRight="21dp"
android:background="@drawable/rounded_input_phone_pass"
android:hint="Telephone nomery"
android:inputType="phone"
android:paddingLeft="23dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2"
app:met_mask="+8(###) ### - ## - ##" />
After first delete numbers in mask. Happend this:
01
02

IndexOutOfBounds when hitting space bar

Using the following mask.

val postCodeMask = Mask(
            value = "___ ___",
            character = '_',
            style = MaskStyle.NORMAL
        )

I get an IndexOutOfBoundsExeption when hitting the space character when the user hits the space bar key, not sure if this an expected behaviour. I would expect here the space bar to be treated as the space character.

Stack trace:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: __________________t, PID: 21295
    java.lang.IndexOutOfBoundsException: setSpan (5 ... 5) ends beyond length 4
        at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1325)
        at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:684)
        at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:676)
        at android.text.Selection.setSelection(Selection.java:94)
        at android.text.Selection.setSelection(Selection.java:78)
        at android.text.Selection.setSelection(Selection.java:153)
        at com.santalu.maskara.MaskResultKt.apply(MaskResult.kt:26)
        at com.santalu.maskara.MaskChangedListener.afterTextChanged(MaskChangedListener.kt:31)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:13388)
        at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:1277)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:577)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:507)
        at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:37)
        at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:843)
        at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197)
        at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:177)
        at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:339)
        at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:89)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

从中间删除时,格式化有问题

bug: 定义手机格式"### #### ####",然后输入123 4567 8900,然后从头部开始删除比如2或者3后,格式变成了12 4567 8900,正确的应该是124 5678 900

[BUG] setText doesn't work.

mask-edittext is totally broken when you use previously saved value. You just can't setText to MaskEditText. Also you cannot fix problem cos MaskEditText is final class.

Could you be so kind to fix this bug? Thx

Support for multi line

Apply mask on the each line:

<com.santalu.maskedittext.MaskEditText
	android:id="@+id/phones_input"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:inputType="textMultiLine|phone"
	android:scrollbars="vertical"
	android:minLines="4"
	android:maxLines="4"
	android:lines="4"
	app:mask="+90(###) ### ## ##"/>

Strange behaviour deleting and writing some characters more times (twice or three)

Strange behaviour: use this example
<com.santalu.maskedittext.MaskEditText
android:id="@+id/etPhoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="some text"
android:inputType="text"
app:met_mask="## ## ## ## ## ## ## ##"
/>

At runtime, put some characters, than delete some of them using back button, do this action (put some characters than delete some ones) more times (twice or three).
As result i see some characters repeated.

Apply mask from right to left

Is it possible to use a mask that as the user enters additional values, they will appear starting with the right-most digit, pushing older digit entries left as they type?
For example, I have the following mask: ##.###,##
What I want to input: 100,00
But since the mask starts from left to right if I try to input 100,00 I will end up with 10.000, due to the natural mask comportament.

Unable to add text in this view

I have used this widget in my project but when I'll try to click on this view in the sake of adding the text, unable to add text in it

Masking Fails when editing from between

Hi,
I am using your mask edittext. It works fine in a normal user case but it fails when i edit a phone number from between
(568) 766-4444
Mask :- (###) ###-####

And then if i put the cursor in between, let say near the "-" and press backspace on the keyboard multiple times, so now the phone number becomes :-
()))) )----85

Version 1.0.0 -> 1.1.1 Change Log?

Hi, you're project is great and I noticed you have a update [1.0.0 -> 1.1.1].

Is it possible to get a change log or release notes on what changed from these two versions? Would love to know if there bug fixes or performance improvements!

Unable to type the number in mask

There is one issue with mask. If you set phone code to let's say +998 (__) ____ - __ - , here the code contains the digits 9 and 8, then you cannot type 9 and 8 when you just open keyboard. Similarly, if it is +78 () ____ - __ - __, then you cannot type 7 and 8 in the beginning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.