void init() { this.handler = new Handler(Looper.getMainLooper()); this.mAnimationCallback = new TimeListener() { public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) { PanelView.this.animationTick(deltaTime); } }; this.mStopAnimator = new Runnable() { public void run() { if (PanelView.this.mTimeAnimator != null && PanelView.this.mTimeAnimator.isStarted()) { PanelView.this.LOG("Stop Animator : stopping", new Object[0]); PanelView.this.mTimeAnimator.end(); PanelView.this.mRubberbanding = false; PanelView.this.mClosing = false; } } }; this.mTimeAnimator = new TimeAnimator(); this.mTimeAnimator.setTimeListener(this.mAnimationCallback); }
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 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(mStartTime + totalTime)) { mTimeAnimator.end(); } } }); mTimeAnimator.start(); } }; }