Merge commit 'b5a79aa3e56321f5616ca560e1e7930193fd392a' * commit 'b5a79aa3e56321f5616ca560e1e7930193fd392a': Fix typo: the x offset was assigned to the y coordinate.
This commit is contained in:
@@ -21,7 +21,6 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.service.wallpaper.WallpaperService;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.content.Context;
|
||||
@@ -87,14 +86,13 @@ public class ImageWallpaper extends WallpaperService {
|
||||
@Override
|
||||
public void onTouchEvent(MotionEvent event) {
|
||||
super.onTouchEvent(event);
|
||||
Log.i("foo", "Touch event: " + event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOffsetsChanged(float xOffset, float yOffset,
|
||||
int xPixels, int yPixels) {
|
||||
mXOffset = xOffset;
|
||||
mYOffset = xOffset;
|
||||
mYOffset = yOffset;
|
||||
drawFrame();
|
||||
}
|
||||
|
||||
@@ -128,9 +126,9 @@ public class ImageWallpaper extends WallpaperService {
|
||||
final int availw = bw-dw;
|
||||
final int availh = bh-dh;
|
||||
int xPixels = availw > 0
|
||||
? -(int)(availw*mXOffset+.5f) : -(int)(availw/2);
|
||||
? -(int)(availw*mXOffset+.5f) : -(availw/2);
|
||||
int yPixels = availh > 0
|
||||
? -(int)(availh*mYOffset+.5f) : -(int)(availh/2);
|
||||
? -(int)(availh*mYOffset+.5f) : -(availh/2);
|
||||
c.translate(xPixels, yPixels);
|
||||
c.drawColor(0xff000000);
|
||||
background.draw(c);
|
||||
|
||||
Reference in New Issue
Block a user