Example usage for android.view Choreographer getInstance

List of usage examples for android.view Choreographer getInstance

Introduction

In this page you can find the example usage for android.view Choreographer getInstance.

Prototype

public static Choreographer getInstance() 

Source Link

Document

Gets the choreographer for the calling thread.

Usage

From source file:android.databinding.ViewDataBinding.java

/**
 * @hide// ww  w  .  j a  va2 s . c om
 */
protected ViewDataBinding(DataBindingComponent bindingComponent, View root, int localFieldCount) {
    mBindingComponent = bindingComponent;
    mLocalFieldObservers = new WeakListener[localFieldCount];
    this.mRoot = root;
    if (Looper.myLooper() == null) {
        throw new IllegalStateException("DataBinding must be created in view's UI Thread");
    }
    if (USE_CHOREOGRAPHER) {
        mChoreographer = Choreographer.getInstance();
        mFrameCallback = new Choreographer.FrameCallback() {
            @Override
            public void doFrame(long frameTimeNanos) {
                mRebindRunnable.run();
            }
        };
    } else {
        mFrameCallback = null;
        mUIThreadHandler = new Handler(Looper.myLooper());
    }
}