Code example for Animation

Methods: initialize, start

0
    public void startAnimation(Animation animation) {
        GLRootView root = getGLRootView();
        if (root == null) throw new IllegalStateException();
 
        mAnimation = animation;
        animation.initialize(getWidth(),
                getHeight(), mParent.getWidth(), mParent.getHeight());
        mAnimation.start();
        root.registerLaunchedAnimation(animation);
        invalidate(); 
    } 
 
    public void setVisibility(int visibility) {
        if (visibility == getVisibility()) return;
        if (visibility == VISIBLE) {
            mViewFlags &= ~FLAG_INVISIBLE;
        } else { 
            mViewFlags |= FLAG_INVISIBLE;
        } 
        onVisibilityChanged(visibility);
        invalidate();