kongsin / ViewAnimationController

KAnimationController will make your view animation simple.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ViewAnimatorController

Note : RelativeLayout is friendly with KAnimationController ^+++^

Preview

Sample Image Sample Image


  • BaseAnimationControl is an animation object
     BaseAnimationObject imageAnimObj = new BaseAnimationObject(img);
  • AnimationQueue for manage queue of the animation object
  • AnimationQueue.nextQueue for add animation queue
  • AnimationQueue.startByQueue for start as a queue
  • AnimationQueue.startTogether for play all animation together
                AnimationQueue animationQueue = new AnimationQueue();
                animationQueue.nextQueue(0, b1);                
                animationQueue.nextQueue(0, b2);
                animationQueue.nextQueue(0, b3);
                animationQueue.startByQueue();
                //or
                //animationQueue.startTogether();

Example

                BaseAnimationObject b1 = new BaseAnimationObject(img).moveToCenterVertical(main).moveToCenterHorizontal(main);
                
                BaseAnimationObject b2 = new BaseAnimationObject(img2);
                b2.stackToLeftOf(b1).marginRight(50);
                
                BaseAnimationObject b3 = new BaseAnimationObject(img3);
                b3.stackToRightOf(b1).marginLeft(50);
                
                AnimationQueue animationQueue = new AnimationQueue();
                animationQueue.nextQueue(0, b1);                
                animationQueue.nextQueue(0, b2);
                animationQueue.nextQueue(0, b3);
                animationQueue.setCallback(new AnimationQueue.AnimatedCallback() {
                    @Override
                    public void finished() {

                    }

                    @Override
                    public void eachQueueFinished(BaseAnimationObject control) {
                        Log.i(TAG, "eachQueueFinished: " + control.getView().getId());
                    }
                });
                
                animationQueue.startByQueue();

About

KAnimationController will make your view animation simple.

License:MIT License


Languages

Language:Java 100.0%