當前位置: 首頁>>代碼示例>>Java>>正文


Java SensorManager.SENSOR_DELAY_UI屬性代碼示例

本文整理匯總了Java中android.hardware.SensorManager.SENSOR_DELAY_UI屬性的典型用法代碼示例。如果您正苦於以下問題:Java SensorManager.SENSOR_DELAY_UI屬性的具體用法?Java SensorManager.SENSOR_DELAY_UI怎麽用?Java SensorManager.SENSOR_DELAY_UI使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.hardware.SensorManager的用法示例。


在下文中一共展示了SensorManager.SENSOR_DELAY_UI屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

private void init(Context context) {
	mSensorDelay = SensorManager.SENSOR_DELAY_UI;

	if (Logger.DEBUG_OPENGL) {
		setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);
	}

	// Wrapper set so the renderer can
	// access the gl transformation matrixes.
	setGLWrapper(new GLWrapper() {
		@Override
		public GL wrap(GL gl) {
			return new MatrixTrackingGL(gl);
		}
	});

	mRenderer = createRenderer();
	mRenderer.setOnBeyondarObjectRenderedListener(this);

	setEGLConfigChooser(8, 8, 8, 8, 16, 0);
	getHolder().setFormat(PixelFormat.TRANSLUCENT);
	setRenderer(mRenderer);

	requestFocus();
	// This call will allow the GLSurface to be on the top of all the
	// Surfaces. It is needed because when the camera is rotated the camera
	// tend to overlap the GLSurface.
	setZOrderMediaOverlay(true);
	setFocusableInTouchMode(true);
}
 
開發者ID:KrishAmal,項目名稱:NavAR,代碼行數:30,代碼來源:ArBeyondarGLSurfaceView.java

示例2: addOrientationListener

private void addOrientationListener() {
    listener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_UI) {
        public void onOrientationChanged(int orientation) {
            if ((orientation >= 230 && orientation <= 290) || (orientation >= 70 && orientation <= 90)) {
                portrait.setText("True");
            }
        }
    };
    if (listener.canDetectOrientation()) listener.enable();
}
 
開發者ID:hacktoberfest17,項目名稱:programming,代碼行數:10,代碼來源:MainActivity.java

示例3: sensorsSpeed

@ProtoMethod(description = "Set the speed of the sensor 'slow', 'fast', 'normal'", example = "")
@ProtoMethodParam(params = {"speed=['slow', 'fast', 'normal']"})
public void sensorsSpeed(String speed) {
    if (speed.equals("slow")) {
        this.speed = SensorManager.SENSOR_DELAY_UI;
    } else if (speed.equals("fast")) {
        this.speed = SensorManager.SENSOR_DELAY_FASTEST;
    } else {
        this.speed = SensorManager.SENSOR_DELAY_NORMAL;
    }
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:11,代碼來源:CustomSensorManager.java

示例4: before

@Override
protected void before(XParam param) throws Throwable {
	switch (mMethod) {
	case getDefaultSensor:
		if (isRestricted(param))
			param.setResult(null);
		else if (param.args.length > 0 && param.args[0] instanceof Integer)
			if (isRestricted(param, (Integer) param.args[0]))
				param.setResult(null);
		break;

	case getSensorList:
		if (isRestricted(param))
			param.setResult(new ArrayList<Sensor>());
		else if (param.args.length > 0 && param.args[0] instanceof Integer)
			if (isRestricted(param, (Integer) param.args[0]))
				param.setResult(new ArrayList<Sensor>());
		break;

	case registerListener:
		if (param.args.length > 2 && param.args[1] instanceof Sensor && param.args[2] instanceof Integer) {
			int type = ((Sensor) param.args[1]).getType();
			if (type == Sensor.TYPE_GYROSCOPE || type == Sensor.TYPE_GYROSCOPE_UNCALIBRATED) {
				int rateUs = (Integer) param.args[2];

				// http://developer.android.com/guide/topics/sensors/sensors_overview.html
				if (rateUs == SensorManager.SENSOR_DELAY_NORMAL)
					return; // 200,000 us
				else if (rateUs == SensorManager.SENSOR_DELAY_UI)
					return; // 60,000 us
				else if (rateUs == SensorManager.SENSOR_DELAY_GAME)
					return; // 20,000 us
				else if (rateUs == SensorManager.SENSOR_DELAY_FASTEST)
					; // 0 us

				if (rateUs < cMaxRateUs) // 10,000 us
					if (isRestricted(param))
						param.args[2] = cMaxRateUs;
			}
		}
		break;
	}
}
 
開發者ID:ukanth,項目名稱:XPrivacy,代碼行數:43,代碼來源:XSensorManager.java


注:本文中的android.hardware.SensorManager.SENSOR_DELAY_UI屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。