Skip to main content


Showing posts with the label Animation

Android : AnimatedVectorDrawable

Android Lollipop introduced a lot of sweet new classes. The one that caught my eye isAnimatedVectorDrawable, and I decided to check it out right away.
Example from Documentation
The documentation included an example, so I created the files as instructed:res/drawable/vectordrawable.xml, res/drawable/avd.xml, res/anim/rotation.xmland res/anim/path_morph.xml

Now what? There are many ways to use a Drawable. How about in a TextView?
No animation yet. Let's start it.
for(Drawable drawable : textView.getCompoundDrawables()){if(drawable instanceofAnimatable){((Animatable) drawable).start();}}

And voilà! Animation. But what is it? Let's step it through.


Animation : Ripples – Part 3

Previously in this series we’ve looked at the ripple effect touch feedback which was introduced in the Android-L developer preview, and looked at how we can define ripples, and also integrate them with existing background drawables. In this concluding article we’ll look at styling our ripples.

In the first article in this series I advocated using android:colorControlHighlight to define the colour of the ripple in the XML drawable definition. The reason for this is that in the Android-L developer preview there are some new colour constant values which make giving our apps a consistent colour theme is much easier. Very much easier!. The more observant may have noticed that the test app containing the sample code is actually themed using Styling Android green on the ActionBar and status bar. However, I did not spend much time and effort in doing this, take a look at the theme: res/values-v21/styles.xml