TransitionDrawable animation

suggest change

This example displays a transaction for an image view with only two images.(can use more images as well one after the other for the first and second layer positions after each transaction as a loop)




—``` private Drawable[] backgroundsDrawableArrayForTransition; private TransitionDrawable transitionDrawable;

private void backgroundAnimTransAction() {

// set res image array
Resources resources = getResources();
TypedArray icons = resources.obtainTypedArray(R.array.splash_images);

Drawable drawable = icons.getDrawable(0);    // ending image

Drawable drawableTwo = icons.getDrawable(1);   // starting image

backgroundsDrawableArrayForTransition = new Drawable[2];
backgroundsDrawableArrayForTransition[0] = drawable;
backgroundsDrawableArrayForTransition[1] = drawableTwo;
transitionDrawable = new TransitionDrawable(backgroundsDrawableArrayForTransition);

// your image view here - backgroundImageView

transitionDrawable.setCrossFadeEnabled(false); // call public methods



Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents