當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。