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


Java WakeLockOptions类代码示例

本文整理汇总了Java中org.andengine.engine.options.WakeLockOptions的典型用法代码示例。如果您正苦于以下问题:Java WakeLockOptions类的具体用法?Java WakeLockOptions怎么用?Java WakeLockOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: acquireWakeLock

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
private void acquireWakeLock(final WakeLockOptions pWakeLockOptions) {
	if (pWakeLockOptions == WakeLockOptions.SCREEN_ON) {
		ActivityUtils.keepScreenOn(this);
	} else {
		final PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
		this.mWakeLock = pm.newWakeLock(pWakeLockOptions.getFlag() | PowerManager.ON_AFTER_RELEASE, Constants.DEBUGTAG);
		try {
			this.mWakeLock.acquire();
		} catch (final SecurityException pSecurityException) {
			Debug.e("You have to add\n\t<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\nto your AndroidManifest.xml !", pSecurityException);
		}
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:BaseGameActivity.java

示例2: acquireWakeLock

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
private void acquireWakeLock(final WakeLockOptions pWakeLockOptions) {
	if(pWakeLockOptions == WakeLockOptions.SCREEN_ON) {
		ActivityUtils.keepScreenOn(this);
	} else {
		final PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
		this.mWakeLock = pm.newWakeLock(pWakeLockOptions.getFlag() | PowerManager.ON_AFTER_RELEASE, Constants.DEBUGTAG);
		try {
			this.mWakeLock.acquire();
		} catch (final SecurityException pSecurityException) {
			Debug.e("You have to add\n\t<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\nto your AndroidManifest.xml !", pSecurityException);
		}
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:14,代码来源:BaseGameActivity.java

示例3: onCreateEngineOptions

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
	camera = new Camera(0, 0, Consts.SCREEN_HEIGHT, Consts.SCREEN_WIDTH);
	EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, 
			new RatioResolutionPolicy(Consts.SCREEN_HEIGHT, Consts.SCREEN_WIDTH), this.camera);
	engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
	engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
	return engineOptions;
}
 
开发者ID:thoinv,项目名称:kaorisan,代码行数:10,代码来源:GameActivity.java

示例4: onCreateEngineOptions

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
	
	prefs = PreferenceManager.getDefaultSharedPreferences(this);
	camera = new FollowCamera(0, 0, Constants.CW, Constants.CH);
	IResolutionPolicy resolutionPolicy = new FillResolutionPolicy();
	EngineOptions engineOptions = new EngineOptions(true,
			ScreenOrientation.PORTRAIT_FIXED, resolutionPolicy, camera);
	engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
	engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
	return engineOptions;
}
 
开发者ID:sm4,项目名称:FlyingDandelion,代码行数:13,代码来源:GameActivity.java

示例5: onCreateEngineOptions

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
    // Camera
    mCamera = new Camera(0, 0, WIDTH, HEIGHT);

    // Engine options
    EngineOptions engineOptions = new EngineOptions(true,
            ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(RATIO), mCamera);

    // Screen always turned on
    engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);

    // Music
    engineOptions.getAudioOptions().setNeedsMusic(true);

    // Sound
    engineOptions.getAudioOptions().setNeedsSound(true);

    // Controls
    if (android.os.Build.MANUFACTURER.equals("OUYA")){ //... Device is an OUYA...
        NinjaTrials.OUYA_CONTROL = true;
        OuyaController.init(this); // Necessary to listen for Ouya Controller's analogic events
    }
    else{ //... Device is something else...
        NinjaTrials.OUYA_CONTROL = false;
    }

    // Return the engineOptions object, passing it to the engine
    return engineOptions;
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:31,代码来源:NinjaTrials.java

示例6: onCreateEngineOptions

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
public EngineOptions onCreateEngineOptions()
{

camara = new Camera(0, 0,  480,800);// Pantalla fullHD? Mala suerte...
   EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(480,800), this.camara);
   // la RatioResolutionPolicy se encarga de añadir márgenes si fuese necesario para que  la escena  mantenga las proporciones.
  
   //necesitamos sonido, internamente inicializa el player
   engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
   engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON); // que no se apaque la pantalla cuando estamos  jugando.
   return engineOptions;
}
 
开发者ID:sprayz,项目名称:Phytris,代码行数:13,代码来源:MainActivity.java

示例7: onCreateEngineOptions

import org.andengine.engine.options.WakeLockOptions; //导入依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() 
{
	camera = new BoundCamera(0, 0, 800, 480);
	EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), camera);
	engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
	engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
	 
	return engineOptions;
}
 
开发者ID:LHBDev,项目名称:MoonMiner,代码行数:11,代码来源:MainActivity.java


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