O'Reilly logo

50 Android Hacks by Carlos Sessa

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

Chapter 2. Creating cool animations

In this chapter, you’ll learn about animations. You’ll find different examples that use a variety of APIs to add animations to your application widgets.

Hack 5 Snappy transitions with TextSwitcher and ImageSwitcher: Android v1.6+

Imagine you need to cycle through information in a TextView or in an ImageView. Some examples of this would be

  • Navigating through a list of dates with Left and Right buttons
  • Changing numbers in a date picker
  • Countdown clock
  • News headlines

Changing the contents of a view is a basic function of most applications, but it doesn’t have to be boring. If we use the default TextView, you’ll notice there’s no eye candy when we swap its content. It’d be nice to have a way to apply ...

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