Android how to make hint filling by typed text

670 Views Asked by At

I want show hint of EditText and when user enter text show part of entered and part of masked hint.

Example i got hint like

(___) ___-__-__

I want on EditText when user enter 985 446 EditText shows

(985) 446-__-__

I can't found solutions.

enter image description here

Look at picture, user already entered +7 (985) 446 but still needs enter last part oh mobile phone number, and it's part is grayed, but showed.

In standart behavior in Android EditText with masked or not, we get next picture (EditText set hint +7 (_) _ --)

enter image description here

but when i will enter first char (+ for example) i got next picture

enter image description here

And it's not what i need.

2

There are 2 best solutions below

1
On
0
On

AFAIK EditText does not have this ability so the best thing you could do is to format the text with addTextChangedListener as the numbers are input