Android TimeAnimator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android TimeAnimator class.

This code example shows how to use the following methods:setTimeListener
            } 
 
            if (mAnim != null) {
                mAnim.cancel();
            } 
            mAnim = new TimeAnimator();
            mAnim.setTimeListener(new TimeAnimator.TimeListener() {
                private long lastPrint = 0;
                public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) {
                    if (DEBUG && totalTime - lastPrint > 5000) {
                        lastPrint = totalTime;
                        for (int i=0; i<getChildCount(); i++) {
                            android.util.Log.d("BeanBag", "bean " + i + ": " + getChildAt(i));
                        } 
                    } 
 
                    for (int i=0; i<getChildCount(); i++) {
                        View v = getChildAt(i);
                        if (!(v instanceof Bean)) continue;
                        Bean nv = (Bean) v;
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
                post(new Runnable() { public void run() {
                    reset(); 
                    startAnimation(); 
                } }); 
            } else { 
                mAnim.start();
            } 
        } 
 
        public void stopAnimation() { 
            if (mAnim != null) mAnim.cancel();
        } 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            stopAnimation(); 
        } 
 
        @Override 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
            mAnim.start();
        } 
 
        protected void onSizeChanged (int w, int h, int oldw, int oldh) {
            super.onSizeChanged(w,h,oldw,oldh);
            mAnim.cancel();
            reset(); 
            mAnim.start();
        } 
 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            mAnim.cancel();
        } 
 
        @Override 
        public boolean isOpaque() { 
            return true; 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:cancel
 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            mAnim.cancel(); 
        } 
 
        @Override 
        public boolean isOpaque() { 
            return true; 
        } 
    } 
 
    private Board mBoard;
 
    @Override 
    public void onStart() { 
        super.onStart(); 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setTimeListener, start
    private Runnable createJBRunnable() {
        // On JB, we rely on TimeAnimator to send events tied with vsync. 
        return new Runnable() {
            @Override 
            public void run() { 
                mTimeAnimator = new TimeAnimator();
                mTimeAnimator.setTimeListener(new TimeListener() {
                    @Override 
                    public void onTimeUpdate(TimeAnimator animation, long totalTime,
                            long deltaTime) {
                        if (!sendEvent(mDownTime + totalTime)) {
                            mTimeAnimator.end();
                        } 
                    } 
                }); 
                mTimeAnimator.start();
            } 
        }; 
    } 
 
    private Runnable createPreJBRunnable() {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
                post(new Runnable() { public void run() {
                    reset(); 
                    startAnimation(); 
                } }); 
            } else { 
                mAnim.start();
            } 
        } 
 
        public void stopAnimation() { 
            if (mAnim != null) mAnim.cancel();
        } 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            stopAnimation(); 
        } 
 
        @Override 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setTimeListener
            } 
 
            if (mAnim != null) {
                mAnim.cancel();
            } 
            mAnim = new TimeAnimator();
            mAnim.setTimeListener(new TimeAnimator.TimeListener() {
                private long lastPrint = 0;
                public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) {
                    if (DEBUG && totalTime - lastPrint > 5000) {
                        lastPrint = totalTime;
                        for (int i=0; i<getChildCount(); i++) {
                            android.util.Log.d("UnicornSack", "unicorn " + i + ": " + getChildAt(i));
                        } 
                    } 
 
                    for (int i=0; i<getChildCount(); i++) {
                        View v = getChildAt(i);
                        if (!(v instanceof Unicorn)) continue;
                        Unicorn nv = (Unicorn) v;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
                post(new Runnable() { public void run() {
                    reset(); 
                    startAnimation(); 
                } }); 
            } else { 
                mAnim.start();
            } 
        } 
 
        public void stopAnimation() { 
            if (mAnim != null) mAnim.cancel();
        } 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            stopAnimation(); 
        } 
 
        @Override 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
                post(new Runnable() { public void run() {
                    reset(); 
                    startAnimation(); 
                } }); 
            } else { 
                mAnim.start();
            } 
        } 
 
        public void stopAnimation() { 
            if (mAnim != null) mAnim.cancel();
        } 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            stopAnimation(); 
        } 
 
        @Override 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:start, cancel
                post(new Runnable() { public void run() {
                    reset(); 
                    startAnimation(); 
                } }); 
            } else { 
                mAnim.start();
            } 
        } 
 
        public void stopAnimation() { 
            if (mAnim != null) mAnim.cancel();
        } 
 
        @Override 
        protected void onDetachedFromWindow() { 
            super.onDetachedFromWindow(); 
            stopAnimation(); 
        } 
 
        @Override 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android TimeAnimator Methods: