当前位置: 首页>>代码示例>>Java>>正文


Java Choreographer.getInstance方法代码示例

本文整理汇总了Java中android.view.Choreographer.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Choreographer.getInstance方法的具体用法?Java Choreographer.getInstance怎么用?Java Choreographer.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.Choreographer的用法示例。


在下文中一共展示了Choreographer.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startRecordingFps

import android.view.Choreographer; //导入方法依赖的package包/类
@ReactMethod
public void startRecordingFps() {
  if (mCatalystSettings == null ||
      !mCatalystSettings.isAnimationFpsDebugEnabled()) {
    return;
  }

  if (mFrameCallback != null) {
    throw new JSApplicationCausedNativeException("Already recording FPS!");
  }
  checkAPILevel();

  mFrameCallback = new FpsDebugFrameCallback(
                        Choreographer.getInstance(),
                        getReactApplicationContext());
  mFrameCallback.startAndRecordFpsAtEachFrame();
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:18,代码来源:AnimationsDebugModule.java

示例2: WallpaperOffsetInterpolator

import android.view.Choreographer; //导入方法依赖的package包/类
public WallpaperOffsetInterpolator(Workspace workspace) {
    mChoreographer = Choreographer.getInstance();
    mInterpolator = new DecelerateInterpolator(1.5f);

    mWorkspace = workspace;
    mWallpaperManager = WallpaperManager.getInstance(workspace.getContext());
    mIsRtl = Utilities.isRtl(workspace.getResources());
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:9,代码来源:WallpaperOffsetInterpolator.java

示例3: start

import android.view.Choreographer; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void start() {
	Log.d(TAG, "start vsync detect");
	if (mRunning) {
		return;
	}
	
	mRunning = true;

	syncCheckThread = new Thread(new Runnable() {
		@Override
		public void run() {
			for (;;) {
				if (!mRunning) {
					break;
				}
				syncCheckThread();
			}
		}
	});
	syncCheckThread.start();
	
	Choreographer chor = Choreographer.getInstance();
	Field field;
	try {
		field = chor.getClass().getDeclaredField("mFrameIntervalNanos");
		field.setAccessible(true);
		mFrameIntervalNanos = field.getLong(chor);
		Log.d(TAG, "mFrameIntervalNanos " + mFrameIntervalNanos);
	} catch (Exception e) {
		Log.e(TAG, "error: " + e.getMessage());
	}
	chor.postFrameCallback(frameCallback);

}
 
开发者ID:lsjwzh,项目名称:FastTextView,代码行数:36,代码来源:FpsCalculator.java

示例4: onLooperPrepared

import android.view.Choreographer; //导入方法依赖的package包/类
@Override
        protected void onLooperPrepared() {
            mSampleChoreographer = Choreographer.getInstance();
            mSampleCallback = new Choreographer.FrameCallback() {
                @Override
                public void doFrame(final long frameTimeNanos) {
                    final long delta = (frameTimeNanos - lastSampleTime) / 1000000;
                    if (lastSampleTime != 0 && delta > delay) {
                        //采样周期不准了,目前丢弃吧
                        //LogUtils.w("monitor", "sample doFrame " + delta);
//                        mCheckerHandler.post(new Runnable() {
//                            @Override
//                            public void run() {
//                                processInfo(lastSampleTime / 1000000,frameTimeNanos / 1000000);
//                            }
//                        });
                    } else {
                        mCheckerHandler.post(new Runnable() {
                            @Override
                            public void run() {
                                statisticsStack(frameTimeNanos / 1000000, delta, StackInfo.TYPE_SAMPLE);
                            }
                        });
                    }
                    lastSampleTime = frameTimeNanos;
                    if (mLoopFlag) {
                        mSampleChoreographer.postFrameCallback(mSampleCallback);
                    }
                }
            };

            lock[0] = true;

        }
 
开发者ID:zongwu233,项目名称:Winter,代码行数:35,代码来源:Monitor.java

示例5: FpsView

import android.view.Choreographer; //导入方法依赖的package包/类
public FpsView(ReactContext reactContext) {
  super(reactContext);
  inflate(reactContext, R.layout.fps_view, this);
  mTextView = (TextView) findViewById(R.id.fps_text);
  mFrameCallback = new FpsDebugFrameCallback(Choreographer.getInstance(), reactContext);
  mFPSMonitorRunnable = new FPSMonitorRunnable();
  setCurrentFPS(0, 0, 0, 0);
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:9,代码来源:FpsView.java

示例6: ReactChoreographer

import android.view.Choreographer; //导入方法依赖的package包/类
private ReactChoreographer() {
  mChoreographer = Choreographer.getInstance();
  mReactChoreographerDispatcher = new ReactChoreographerDispatcher();
  mCallbackQueues = new ArrayDeque[CallbackType.values().length];
  for (int i = 0; i < mCallbackQueues.length; i++) {
    mCallbackQueues[i] = new ArrayDeque<>();
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:9,代码来源:ReactChoreographer.java

示例7: redraw

import android.view.Choreographer; //导入方法依赖的package包/类
protected void redraw() {
    log("redraw()");
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        // stay in sync with display updates
        Choreographer choreographer = Choreographer.getInstance();
        choreographer.removeFrameCallback(redrawCallback);
        choreographer.postFrameCallback(redrawCallback);

    } else {
        redrawInternal();
    }
}
 
开发者ID:timothymiko,项目名称:narrate-android,代码行数:13,代码来源:AbsView.java

示例8: enable

import android.view.Choreographer; //导入方法依赖的package包/类
@Override
public void enable() {
  haveSync = false;
  if (usePrimaryDisplayVsync) {
    sampledVsyncTimeNs = 0;
    choreographer = Choreographer.getInstance();
    choreographer.postFrameCallback(this);
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:10,代码来源:SmoothFrameReleaseTimeHelper.java

示例9: FpsDataModule

import android.view.Choreographer; //导入方法依赖的package包/类
public FpsDataModule(int interval) {
    this.interval = interval;
    this.choreographer = Choreographer.getInstance();
}
 
开发者ID:Manabu-GT,项目名称:DebugOverlay-Android,代码行数:5,代码来源:FpsDataModule.java

示例10: Metronome

import android.view.Choreographer; //导入方法依赖的package包/类
public Metronome() {
  choreographer = Choreographer.getInstance();
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:4,代码来源:Metronome.java

示例11: createChoreographerInstanceInternal

import android.view.Choreographer; //导入方法依赖的package包/类
private void createChoreographerInstanceInternal() {
  choreographer = Choreographer.getInstance();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:VideoFrameReleaseTimeHelper.java

示例12: create

import android.view.Choreographer; //导入方法依赖的package包/类
/**
 * @return an Android spring choreographer using the system {@link Choreographer}
 */
public static ChoreographerAndroidSpringLooper create() {
  return new ChoreographerAndroidSpringLooper(Choreographer.getInstance());
}
 
开发者ID:gitxuyulin,项目名称:EditorImageAndText,代码行数:7,代码来源:AndroidSpringLooperFactory.java

示例13: getChoreographer

import android.view.Choreographer; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private Choreographer getChoreographer() {
  return Choreographer.getInstance();
}
 
开发者ID:wensefu,项目名称:StackCardsView,代码行数:5,代码来源:ChoreographerCompat.java

示例14: create

import android.view.Choreographer; //导入方法依赖的package包/类
public static ChoreographerAndroidSpringLooper create() {
    return new ChoreographerAndroidSpringLooper(Choreographer.getInstance());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:AndroidSpringLooperFactory.java

示例15: getChoreographer

import android.view.Choreographer; //导入方法依赖的package包/类
@TargetApi(16)
private Choreographer getChoreographer() {
    return Choreographer.getInstance();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:ChoreographerCompat.java


注:本文中的android.view.Choreographer.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。