Friday, 19 April 2019

How to create a "type along" style interface?

I'm talking about something like this:

a screen with gray hints where the user types along and the letters turn black

The image is just an example, I simply need the user to type a certain text letter by letter.


I tried it with an overlaying TextViewon an EditText, but it looks really ugly:

enter image description here

My next attempt would be to use Spannables to turn the overlaying text the same color after each letter with a TextWatcher, as suggested in How can I change the color of a part of a TextView?


But even with the Spannable class it does not fit perfectly and I have to experiment with the TextView paddings to align it with the EditText.

Are there better ways of doing this?



from How to create a "type along" style interface?

No comments:

Post a Comment