Archive for the ‘Animation’ Category
In the previous article in this series we began the update of the TextClock app widget, lock screen widget, and daydream by selectively, according to OS version, updating the colours to match the new KitKat theme. In this article we’ll look at adding some animations.
Previously in this series we’ve looked at a few aspects of Transition animations, but all of the examples have comprised of the views being animated having a single, common parent. In other words, they are all children of the same parent layout. However, Android layouts are rarely as simple as the example layouts that we’ve been looking at. In this concluding article we’ll have a look in to why the ChangeBounds transition has this limitation, and some potential work arounds.
In the previous article we looked at Scenes and how they can be used to encapsulate static view hierarchy states, however we’ve only looked at moving items around. In this article we’ll look at different use cases for our animations and see how we can use different transitions.
In the previous article we began looking at the new Transition Animations API introduced in KitKat 4.4. In this article we’ll have a look beyond the basics and explore how we can take greater control over things using Scenes.
As I write, it is less than two weeks since Google announced Android 4.4 KitKat. There are quite a few new APIs in this version of Android, and in this series we’ll have a look at the all-new Transition Animations.
In the previous articles we have looked at a couple of animation types and the stock interpolators that are available to us. Next we’ll look at the remaining animation types.
You can get the source code for the project that we’re working on here.
We’ve already encountered translate and alpha animations, and there are a couple more: rotate and scale. These are fairly self-explanatory as they allow us to rotate and scale a view respectively. There is a final animation type, known as an Animation Set which allows us to combine animations together. Animation sets are extremely powerful, and allow us to do some quite complex things.
It is worth pointing out that there are some stock animations available to us but, for some reason, in Android 2.3.3 only four are actually made public so that we can actually use them in our apps. The good news is that they are visible in AOSP, and there are some useful techniques that we can learn by studying some of the animations used by Android itself.