Android keyboard for bank account entry [0-9-xX] -
i need edittext input type allows me increase experience of user when he/she entering bank account or bank branch. numbers should follow rules:
account: \d{1,5}-\d{1,2}|x --> 1 5 numeric digits, dash, 1 or 2 numeric digits or 1 x character
branch: \d{1,5}(-\d{1,2}|-x)? --> 1 5 numeric digits, dash, zero, 1 or 2 numeric digits or 1 x character
as entry have more numeric digits want keyboard offer numbers primarily, , if user have x digit he/she can swap input type. want keyboard symbolic layout displayed first.
update:
i tried changing input type in edit text xml:
<edittext style="@style/subhead.form" android:inputtype="text" android:maxlength="7" app:hint="@{@string/profile_hint_bankbranch}" app:bindto="@{viewmodel.branch.input}" tools:text="1234-5"/>
but presents text layout first, expected, tried several other options think none want.
in ios i'm using "numbers , punctuation" keyboard type, want, there easy solution have same behaviour?
you can use "phone" inputtype on edittext. reduce keyboard numbers , dashes. http://developer.android.com/training/keyboard-input/style.html
for more fancy stuff (regex-check, autocomplete, changing keyboard style) have resort custom text change listener. http://developer.android.com/reference/android/widget/textview.html#addtextchangedlistener(android.text.textwatcher)
Comments
Post a Comment