4

Anyone knows any efficient method of perform an animation that what is has to do is to display a text, character by character,

For an example

I have the value in TextView as 1225 Now the value will be change into 1250. Now I need to do the animation like:

1225 the last digit (5) wants to Faded Top and the new value 6 will be appear like wise I need to increment the 1225 value until it reach 1250. Anyone give me the suggestion to do this

No_Rulz
  • 2,679
  • 1
  • 20
  • 33
  • 1
    Using framelayout allows you to slide/fade views each one over the other (with transparent background for example). But in your case the problem is that you don't want the first digits to change (be fade). As long as all the digits are in the same textview it'll probably not work the way you want it. Putting each digit in it's own textview should probably work. Then by using framelayout you'll be able to slide/fade each digit with another. For my information : Have you seen such things around in other applications ? – HpTerm Jun 28 '13 at 06:42
  • Nope I didn't see this kind of animation in other application – No_Rulz Jun 28 '13 at 07:25
  • So as I said I think you'll have to put each digit in a different textview and manage their spacing/sliding/transparence in a framelayout. It'll be a long way ... but possible for me. Sorry I don't have code to provide. I Have code for views pushing each other as you find in "stickyheaders" for listview. But it is simply pushing a view in the frame layout correctly calculating their respective positions. Doesn't think it'll help you that much. – HpTerm Jun 28 '13 at 07:35
  • Can you maybe post a simple image explaining the animation you want? – user Jul 01 '13 at 07:49

1 Answers1

0

You could use TextSwitcher.

Take a look to the API Demo for TextSwitcher. You can use setInAnimation() and setOutAnimation() in combination con setText(), so the text will change animatedly.

UPDATE

I found a good solution here!

Community
  • 1
  • 1
Jorge Gil
  • 4,265
  • 5
  • 38
  • 57