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;
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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; 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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(); 
 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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() {
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Android TimeAnimator Methods: