本文整理汇总了Java中android.service.wallpaper.WallpaperService类的典型用法代码示例。如果您正苦于以下问题:Java WallpaperService类的具体用法?Java WallpaperService怎么用?Java WallpaperService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WallpaperService类属于android.service.wallpaper包,在下文中一共展示了WallpaperService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LiveWallpaperListAdapter
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public LiveWallpaperListAdapter(Context context) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mPackageManager = context.getPackageManager();
List<ResolveInfo> list = mPackageManager.queryIntentServices(
new Intent(WallpaperService.SERVICE_INTERFACE),
PackageManager.GET_META_DATA);
mWallpapers = new ArrayList<LiveWallpaperTile>();
new LiveWallpaperEnumerator(context).execute(list);
}
示例2: onCreateEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
@Override
public WallpaperService.Engine onCreateEngine() {
if (engine!=null) {
// engine.painting.stopPainting();
Log.e(TAG, "DOUBLE ENGINEsss?");
engine = null;
}
engine = new AwesomeWallpaperEngine();
return engine;
}
示例3: onSensorChanged
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor == mAccelerometer) {
System.arraycopy(event.values, 0, mLastAccelerometer, 0, event.values.length);
mLastAccelerometerSet = true;
} else if (event.sensor == mMagnetometer) {
System.arraycopy(event.values, 0, mLastMagnetometer, 0, event.values.length);
mLastMagnetometerSet = true;
}
if (mLastAccelerometerSet && mLastMagnetometerSet) {
SensorManager.getRotationMatrix(mR, null, mLastAccelerometer, mLastMagnetometer);
try {
mDisplay = ((WindowManager) ((WallpaperService) context).getApplication().getSystemService(Service.WINDOW_SERVICE))
.getDefaultDisplay();
} catch (Exception ignored){}
int rotation = Surface.ROTATION_0;
if(mDisplay != null) {
rotation = mDisplay.getRotation();
}
float[] mRremap = mR.clone();
if(rotation == Surface.ROTATION_90){
SensorManager.remapCoordinateSystem(mR, SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X, mRremap);
}
if(rotation == Surface.ROTATION_270){
SensorManager.remapCoordinateSystem(mR, SensorManager.AXIS_MINUS_Y, SensorManager.AXIS_X, mRremap);
}
if(rotation == Surface.ROTATION_180){
SensorManager.remapCoordinateSystem(mR, SensorManager.AXIS_MINUS_X, SensorManager.AXIS_MINUS_Y, mRremap);
}
SensorManager.getOrientation(mRremap, mOrientation);
}
}
示例4: onCreateEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
@Override
public WallpaperService.Engine onCreateEngine()
{
Log.v(LOG_TAG, "package_name: " + getPackageName());
Defines.packageName = getPackageName();
puvoWallpaperRenderer = new PuvoWallpaperRenderer();
return new PuvoWallpaperEngine(puvoWallpaperRenderer);
}
示例5: getEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public WallpaperService.Engine getEngine() {
return mWallpaperEngine;
}
示例6: setEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public void setEngine(WallpaperService.Engine engine) {
this.mWallpaperEngine = engine;
}
示例7: getEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public WallpaperService.Engine getEngine() {
return mWallpaperEngine;
}
示例8: setEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public void setEngine(WallpaperService.Engine engine) {
this.mWallpaperEngine = engine;
}
示例9: onCreateEngine
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public WallpaperService.Engine onCreateEngine() {
return new Wallpaper.Engine();
}
示例10: wallpaperService
import android.service.wallpaper.WallpaperService; //导入依赖的package包/类
public static WallpaperService wallpaperService() {
return (WallpaperService) get(Context.WALLPAPER_SERVICE);
}