0

I searching for a way to animate views via xml, I am really lost in this part of UI programming.

Can anybody explain to me step by step how to do this?

Roman Panaget
  • 1,578
  • 12
  • 21

1 Answers1

0

You can animate android views by using Animation resources.

With xml animations you can set different properties e.g duration, rate of change (interpolator).

AndroidHive has a very good tutorial with a nice set of animations

http://www.androidhive.info/2013/06/android-working-with-xml-animations/

From my experience with xml animations, you won't know what you want until you've played around with different properties.

http://developer.android.com/guide/topics/resources/animation-resource.html

Update:

Interpolators as well are also important,they allow you to achieve a lot more smoothness. But misusing them can also be expensive so be make sure its necessary.

http://developer.android.com/reference/android/view/animation/Interpolator.html

This blog also gives a quick peek into the actual effects of interpolators:

http://android-er.blogspot.co.uk/2012/02/various-effect-of-interpolator-in.html

AndroidEnthusiast
  • 6,557
  • 10
  • 42
  • 56
  • Good answer ! Thank you very much. Can you explain me what if want to code animations with java? Do you have any web for java animations tutorials? Which way is better for animating views? – Roman Panaget Jan 21 '15 at 21:21
  • @RomanPanaget "what if want to code animations with java" I'm not sure what you mean by this. Do you mean you want to apply animations programatically? – AndroidEnthusiast Jan 26 '15 at 11:07
  • Yup, that's what I mean (I'm spanish) – Roman Panaget Jan 26 '15 at 17:36
  • yes you can do that programatically using the same properties, there are a lot of examples and previous stack overflow questions on this. Example: http://stackoverflow.com/questions/4977138/full-example-of-how-to-programmatically-do-rotateanimations and – AndroidEnthusiast Jan 26 '15 at 17:43
  • Great, I know about ScaleAnimation, RotateAnimation and TranslateAnimation classes. Is there any other class to do animations that I must know? – Roman Panaget Jan 26 '15 at 17:48
  • Thank you, I'll see this tonight !! – Roman Panaget Jan 26 '15 at 17:59