Defaulting wallpaper offset to edge of the screen.
am: 4b4ba90d66
Change-Id: I5b851e685637f564ec32dbef9e1437407cf3ea7f
This commit is contained in:
@@ -246,7 +246,10 @@ class WallpaperController {
|
|||||||
|
|
||||||
boolean updateWallpaperOffset(WindowState wallpaperWin, int dw, int dh, boolean sync) {
|
boolean updateWallpaperOffset(WindowState wallpaperWin, int dw, int dh, boolean sync) {
|
||||||
boolean rawChanged = false;
|
boolean rawChanged = false;
|
||||||
float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : 0.5f;
|
// Set the default wallpaper x-offset to either edge of the screen (depending on RTL), to
|
||||||
|
// match the behavior of most Launchers
|
||||||
|
float defaultWallpaperX = wallpaperWin.isRtl() ? 1f : 0f;
|
||||||
|
float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : defaultWallpaperX;
|
||||||
float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f;
|
float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f;
|
||||||
int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw;
|
int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw;
|
||||||
int offset = availw > 0 ? -(int)(availw * wpx + .5f) : 0;
|
int offset = availw > 0 ? -(int)(availw * wpx + .5f) : 0;
|
||||||
|
|||||||
@@ -2939,4 +2939,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRtl() {
|
||||||
|
return mMergedConfiguration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user