本文整理匯總了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);
}