Anyone knows any efficient method of perform an animation that what is has to do is to display a text, character by character? Like:
T
Th
Thi
This
This i
This is
...
And so on.
Thanks!
Anyone knows any efficient method of perform an animation that what is has to do is to display a text, character by character? Like:
T
Th
Thi
This
This i
This is
...
And so on.
Thanks!
Yep,I know it's been a while but I hope to help others with a different approach using ValueAnimator
I think is more appropriate, rather solution above, of course if you are using RxJava
You can use this library for the same: TypeWriterView Android library
A glimpse into the library:
This may not be the most elegant solution, but the simplest is probably a quick subclass of
TextView
with aHandler
that updates the text every so often until the complete sequence is displayed:You can then use this in an Activity like so:
If you want some animation effects with each letter added, perhaps look at subclassing
TextSwitcher
instead.Hope that Helps!
use Devunwired's Typewriter class
then, in the layout:
code in the activity:
I know its too late now but someone still may arrive here from Google. Actually, I too needed something like this for my app, so made one myself. Try out Fade-In TextView, it makes every character appear with a smooth alpha animation. Usage is also quite simple.
In the XML layout
In the Activity/Fragment
Some more information
The Fade-In TextView library inherits its properties directly from the native TextView class, which means that all the native TextView methods are supported. There are practically no limitations including multiline support. The library also has some of its own methods and attributes which offer full control over the View.
I used a recursive method, also added a bit delay in between words to have more human feel. Send the textView as view along with the text and send '1' as the length to type from start