Friday, March 15, 2013

DevBytes: PictureViewer

PictureViewer: How to use ViewPropertyAnimator to get a cross-fade effect as new bitmaps get installed in an ImageView.

TransitionDrawable is a handy and easy facility for cross-fading between two drawables. But if you want to cross-fade between an arbitrary set of images, you might want something more general-purpose. Here's one approach.

YouTube: https://www.youtube.com/watch?v=9XbKMUtVnJA

Code: http://developer.android.com/shareables/devbytes/PictureViewer.zip

2 comments:

John Whipple said...

Chet,

Long time fan of Filthy Rich Clients. Wrote an internal employee directory Java app with animations galore. My managers ate it up.

Quick question about the video. How are you streaming the demo video from your phone? HDMI?

Cheers,
John

Chet Haase said...

@John: Yes: The Galaxy Nexus (the device used in these episodes) streams HDMI out (via MHL, I believe). It's a standard feature; you just need to get a micro USB adapter.
ps: yay animations!