Images
Documentation
Component
Android ImageLoader - load images sequentially in the background
Learning
Animation
For simple cross-fades between two simple bitmaps (from DevBytes: CrossFading Animations):
BitmapDrawable drawables[] = new BitmapDrawable[2];
drawables[0] = new BitmapDrawable(getResources(), bitmap0);
drawables[1] = new BitmapDrawable(getResources(), bitmap1);
// The cross-fade effect happens by fading one out and the other in.
final TransitionDrawable crossfader = new TransitionDrawable(drawables);
imageview.setImageDrawable(crossfader);
imageview.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCurrentDrawable == 0) {
crossfader.startTransition(500);
mCurrentDrawable = 1;
} else {
crossfader.reverseTransition(500);
mCurrentDrawable = 0;
}
}
});
Sample
imageView.setImageResource(R.drawable.pencils);