2

I am working with android, trying to animate some text (make it bigger and smaller over time) and I have the following issue. I cant animate the text using the following:

int textSize = calculateTextSize();

paint.setTextSize(textSize);

canvas.drawText("Some Text", 10, 25, paint);

calculateTextSize , shrinks or enlarge the text size over time.

The issue is that the text doesnt animate, but 'jumps' over from size 20, to 19 to 18, etc Its not an animation, but changing the text of sizes.

How I can animate text on the canvas on andriod?

Thanks

Community
  • 1
  • 1
Daniel Benedykt
  • 6,496
  • 12
  • 51
  • 73

1 Answers1

0

You should use Canvas.scale() instead. This will let you do smooth animations.

Romain Guy
  • 97,993
  • 18
  • 219
  • 200
  • thanks, one follow up question. is it possible to do Android Animations on the LiveWallpaper (like the ones we can do on the activity) instead of doing all the calculations and drawing on the canvas? Thanks – Daniel Benedykt Aug 27 '10 at 16:15
  • What about if Canvas already contains various Bitmaps and lines, but only when performing for example fling, should trigger text to show starting from 0 size to full size with animation? – Niko Nov 15 '12 at 06:58