O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other animations

Morphing path data is one of the the most fun ways to animate icons (and other drawables), but sometimes we just need a simple symmetrical motion, such as rotation and translation.

The following example demonstrates how to apply one of these animation types:

  1. Select a vector drawable of your choice and save its pathData as a string. Here, we have taken the data from the asset studio using the ic_first_page_black_24dp icon:
<string name="first_page">     M18.41,16.59 L13.82,12 l4.59,-4.59 L17,6 l-6,6 6,6 z             M6,6 h2 v12 H6 z </string> 
the ic_first_page_black_24dp icon
  1. As before, create an XML asset for this; here, we will call ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required