Android graphics: How does TransitionDrawable work?

Last Updated:

  1. soBinary

    soBinary Member

    I read the documentation but I can't manage to make a transition occur. What's the flow of events supposed to be like? Who calls who?

    Suppose I wanted to have an activity call init() to draw line a, and call go to make a 5 second transition to line b. What would I have to do to this code?

    public class Fun extends View
    Drawable a;
    Drawable b;
    TransitionDrawable t;
    public Fun(Context context)
    a = new LineA();
    b = new LineB();
    Drawable ray[] = {a,b};
    t = new TransitionDrawable( ray );

    protected void onDraw(Canvas canvas)


    public void init()

    public void go()


Share This Page