Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Animation Tools


Animation Tools


Material design introduced many nifty animations. Some of them can be achieved quickly. Others
require more work, but Android provides some tools to help you out.


Circular reveal


The circular reveal animation is used in material design to look like an ink flood-fill. A view or piece
of content is progressively revealed outward from a point of interaction, usually a point pressed by the
user. Figure 35.6 gives you an idea of what a circular reveal can bring to the party.


Figure 35.6  Circular reveal from pressing an item in BeatBox


You may remember using a simple version of this way back in Chapter 6, where you used it to hide a
button. Here we will talk about another, slightly more involved way to use a circular reveal.


To create a circular reveal animation, you call the createCircularReveal(...) method on
ViewAnimationUtils. This method takes in quite a few parameters:


static Animator createCircularReveal(View view, int centerX, int centerY,
float startRadius, float endRadius)

Free download pdf