Preventing reloading of pages on swipe and disabling offsets for xlarge static wallpapers.

Change-Id: I4ca72164775d09706e36c38e0fac0e84254221c7
This commit is contained in:
Winson Chung
2010-08-24 11:08:22 -07:00
parent a63c452f5b
commit 86f7753bbd
5 changed files with 156 additions and 144 deletions
+9 -5
View File
@@ -499,11 +499,15 @@ public class Workspace extends ViewGroup
}
private void updateWallpaperOffset(int scrollRange) {
IBinder token = getWindowToken();
if (token != null) {
mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0 );
mWallpaperManager.setWallpaperOffsets(getWindowToken(),
Math.max(0.f, Math.min(mScrollX/(float)scrollRange, 1.f)), 0);
final boolean isStaticWallpaper = (mWallpaperManager != null) &&
(mWallpaperManager.getWallpaperInfo() == null);
if (LauncherApplication.isScreenXLarge() && !isStaticWallpaper) {
IBinder token = getWindowToken();
if (token != null) {
mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0 );
mWallpaperManager.setWallpaperOffsets(getWindowToken(),
Math.max(0.f, Math.min(mScrollX/(float)scrollRange, 1.f)), 0);
}
}
}