本文整理汇总了Java中android.view.Choreographer.FrameCallback类的典型用法代码示例。如果您正苦于以下问题:Java FrameCallback类的具体用法?Java FrameCallback怎么用?Java FrameCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FrameCallback类属于android.view.Choreographer包,在下文中一共展示了FrameCallback类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VrShellDelegate
import android.view.Choreographer.FrameCallback; //导入依赖的package包/类
private VrShellDelegate(ChromeActivity activity, VrClassesWrapper wrapper) {
mActivity = activity;
mVrClassesWrapper = wrapper;
// If an activity isn't resumed at the point, it must have been paused.
mPaused = ApplicationStatus.getStateForActivity(activity) != ActivityState.RESUMED;
updateVrSupportLevel();
mNativeVrShellDelegate = nativeInit();
mFeedbackFrequency = VrFeedbackStatus.getFeedbackFrequency();
mEnterVrHandler = new Handler();
Choreographer.getInstance().postFrameCallback(new FrameCallback() {
@Override
public void doFrame(long frameTimeNanos) {
if (mNativeVrShellDelegate == 0) return;
Display display =
((WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
nativeUpdateVSyncInterval(
mNativeVrShellDelegate, frameTimeNanos, 1.0d / display.getRefreshRate());
}
});
ApplicationStatus.registerStateListenerForAllActivities(this);
}