1

I would love to add this elegant verification code screen to my app but I'm completely lost in how to do it

should I implement each box as a TextInputEditText ?

how can I make the cursor move from one box to the next one while typing ?

ps : I'm using kotlin

enter image description here

Wael Fadl Ãllåh
  • 167
  • 1
  • 3
  • 10
  • 1
    try to check this link : https://stackoverflow.com/questions/19442622/how-to-change-the-focus-to-next-edit-text-in-android – B.mansouri Sep 11 '20 at 10:05

1 Answers1

1

I would make those boxes as a TextViews (not EditText) - you don't want to have a soft keyboard opened and the user will be only using buttons below in order to enter verification code.

When the user presses number below - show it in the next available TextView, when every TextView is filled with number - verify whole code. The same should work backspace button - clearing previous filled TextView.

You might want to make TextView to be highlight when it is going to be filled with the next number press, you can do this with a state-list background.

Demigod
  • 5,073
  • 3
  • 31
  • 49