Loading api/6.xml +19 −0 Original line number Diff line number Diff line Loading @@ -25097,6 +25097,21 @@ <exception name="IOException" type="java.io.IOException"> </exception> </method> <method name="setWallpaperOffsetSteps" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="xStep" type="float"> </parameter> <parameter name="yStep" type="float"> </parameter> </method> <method name="setWallpaperOffsets" return="void" abstract="false" Loading Loading @@ -123675,6 +123690,10 @@ </parameter> <parameter name="yOffset" type="float"> </parameter> <parameter name="xOffsetStep" type="float"> </parameter> <parameter name="yOffsetStep" type="float"> </parameter> <parameter name="xPixelOffset" type="int"> </parameter> <parameter name="yPixelOffset" type="int"> api/current.xml +19 −0 Original line number Diff line number Diff line Loading @@ -25108,6 +25108,21 @@ <exception name="IOException" type="java.io.IOException"> </exception> </method> <method name="setWallpaperOffsetSteps" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="xStep" type="float"> </parameter> <parameter name="yStep" type="float"> </parameter> </method> <method name="setWallpaperOffsets" return="void" abstract="false" Loading Loading @@ -123762,6 +123777,10 @@ </parameter> <parameter name="yOffset" type="float"> </parameter> <parameter name="xOffsetStep" type="float"> </parameter> <parameter name="yOffsetStep" type="float"> </parameter> <parameter name="xPixelOffset" type="int"> </parameter> <parameter name="yPixelOffset" type="int"> core/java/android/app/WallpaperManager.java +18 −3 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ import java.io.InputStream; public class WallpaperManager { private static String TAG = "WallpaperManager"; private static boolean DEBUG = false; private float mWallpaperXStep = -1; private float mWallpaperYStep = -1; /** * Launch an activity for the user to pick the current global live Loading Loading @@ -575,20 +577,33 @@ public class WallpaperManager { * @param windowToken The window who these offsets should be associated * with, as returned by {@link android.view.View#getWindowToken() * View.getWindowToken()}. * @param xOffset The offset olong the X dimension, from 0 to 1. * @param xOffset The offset along the X dimension, from 0 to 1. * @param yOffset The offset along the Y dimension, from 0 to 1. */ public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) { try { //Log.v(TAG, "Sending new wallpaper offsets from app..."); ViewRoot.getWindowSession(mContext.getMainLooper()).setWallpaperPosition( windowToken, xOffset, yOffset); windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep); //Log.v(TAG, "...app returning after sending offsets!"); } catch (RemoteException e) { // Ignore. } } /** * For applications that use multiple virtual screens showing a wallpaper, * specify the step size between virtual screens. For example, if the * launcher has 5 virtual screens, it would specify an xStep of 0.5, * since the X offset for those screens are 0.0, 0.5 and 1.0 * @param xStep The X offset delta from one screen to the next one * @param yStep The Y offset delta from one screen to the next one */ public void setWallpaperOffsetSteps(float xStep, float yStep) { mWallpaperXStep = xStep; mWallpaperYStep = yStep; } /** * Send an arbitrary command to the current active wallpaper. * Loading Loading @@ -627,7 +642,7 @@ public class WallpaperManager { public void clearWallpaperOffsets(IBinder windowToken) { try { ViewRoot.getWindowSession(mContext.getMainLooper()).setWallpaperPosition( windowToken, -1, -1); windowToken, -1, -1, -1, -1); } catch (RemoteException e) { // Ignore. } Loading core/java/android/service/wallpaper/WallpaperService.java +12 −2 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ public abstract class WallpaperService extends Service { boolean mOffsetMessageEnqueued; float mPendingXOffset; float mPendingYOffset; float mPendingXOffsetStep; float mPendingYOffsetStep; boolean mPendingSync; MotionEvent mPendingMove; Loading Loading @@ -227,11 +229,14 @@ public abstract class WallpaperService extends Service { } @Override public void dispatchWallpaperOffsets(float x, float y, boolean sync) { public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) { synchronized (mLock) { if (DEBUG) Log.v(TAG, "Dispatch wallpaper offsets: " + x + ", " + y); mPendingXOffset = x; mPendingYOffset = y; mPendingXOffsetStep = xStep; mPendingYOffsetStep = yStep; if (sync) { mPendingSync = true; } Loading Loading @@ -360,6 +365,7 @@ public abstract class WallpaperService extends Service { * WallpaperManager.setWallpaperOffsets()}. */ public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) { } Loading Loading @@ -608,10 +614,14 @@ public abstract class WallpaperService extends Service { float xOffset; float yOffset; float xOffsetStep; float yOffsetStep; boolean sync; synchronized (mLock) { xOffset = mPendingXOffset; yOffset = mPendingYOffset; xOffsetStep = mPendingXOffsetStep; yOffsetStep = mPendingYOffsetStep; sync = mPendingSync; mPendingSync = false; mOffsetMessageEnqueued = false; Loading @@ -622,7 +632,7 @@ public abstract class WallpaperService extends Service { final int xPixels = availw > 0 ? -(int)(availw*xOffset+.5f) : 0; final int availh = mIWallpaperEngine.mReqHeight-mCurHeight; final int yPixels = availh > 0 ? -(int)(availh*yOffset+.5f) : 0; onOffsetsChanged(xOffset, yOffset, xPixels, yPixels); onOffsetsChanged(xOffset, yOffset, xOffsetStep, yOffsetStep, xPixels, yPixels); if (sync) { try { Loading core/java/android/view/IWindow.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ oneway interface IWindow { /** * Called for wallpaper windows when their offsets change. */ void dispatchWallpaperOffsets(float x, float y, boolean sync); void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync); Loading Loading
api/6.xml +19 −0 Original line number Diff line number Diff line Loading @@ -25097,6 +25097,21 @@ <exception name="IOException" type="java.io.IOException"> </exception> </method> <method name="setWallpaperOffsetSteps" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="xStep" type="float"> </parameter> <parameter name="yStep" type="float"> </parameter> </method> <method name="setWallpaperOffsets" return="void" abstract="false" Loading Loading @@ -123675,6 +123690,10 @@ </parameter> <parameter name="yOffset" type="float"> </parameter> <parameter name="xOffsetStep" type="float"> </parameter> <parameter name="yOffsetStep" type="float"> </parameter> <parameter name="xPixelOffset" type="int"> </parameter> <parameter name="yPixelOffset" type="int">
api/current.xml +19 −0 Original line number Diff line number Diff line Loading @@ -25108,6 +25108,21 @@ <exception name="IOException" type="java.io.IOException"> </exception> </method> <method name="setWallpaperOffsetSteps" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="xStep" type="float"> </parameter> <parameter name="yStep" type="float"> </parameter> </method> <method name="setWallpaperOffsets" return="void" abstract="false" Loading Loading @@ -123762,6 +123777,10 @@ </parameter> <parameter name="yOffset" type="float"> </parameter> <parameter name="xOffsetStep" type="float"> </parameter> <parameter name="yOffsetStep" type="float"> </parameter> <parameter name="xPixelOffset" type="int"> </parameter> <parameter name="yPixelOffset" type="int">
core/java/android/app/WallpaperManager.java +18 −3 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ import java.io.InputStream; public class WallpaperManager { private static String TAG = "WallpaperManager"; private static boolean DEBUG = false; private float mWallpaperXStep = -1; private float mWallpaperYStep = -1; /** * Launch an activity for the user to pick the current global live Loading Loading @@ -575,20 +577,33 @@ public class WallpaperManager { * @param windowToken The window who these offsets should be associated * with, as returned by {@link android.view.View#getWindowToken() * View.getWindowToken()}. * @param xOffset The offset olong the X dimension, from 0 to 1. * @param xOffset The offset along the X dimension, from 0 to 1. * @param yOffset The offset along the Y dimension, from 0 to 1. */ public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) { try { //Log.v(TAG, "Sending new wallpaper offsets from app..."); ViewRoot.getWindowSession(mContext.getMainLooper()).setWallpaperPosition( windowToken, xOffset, yOffset); windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep); //Log.v(TAG, "...app returning after sending offsets!"); } catch (RemoteException e) { // Ignore. } } /** * For applications that use multiple virtual screens showing a wallpaper, * specify the step size between virtual screens. For example, if the * launcher has 5 virtual screens, it would specify an xStep of 0.5, * since the X offset for those screens are 0.0, 0.5 and 1.0 * @param xStep The X offset delta from one screen to the next one * @param yStep The Y offset delta from one screen to the next one */ public void setWallpaperOffsetSteps(float xStep, float yStep) { mWallpaperXStep = xStep; mWallpaperYStep = yStep; } /** * Send an arbitrary command to the current active wallpaper. * Loading Loading @@ -627,7 +642,7 @@ public class WallpaperManager { public void clearWallpaperOffsets(IBinder windowToken) { try { ViewRoot.getWindowSession(mContext.getMainLooper()).setWallpaperPosition( windowToken, -1, -1); windowToken, -1, -1, -1, -1); } catch (RemoteException e) { // Ignore. } Loading
core/java/android/service/wallpaper/WallpaperService.java +12 −2 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ public abstract class WallpaperService extends Service { boolean mOffsetMessageEnqueued; float mPendingXOffset; float mPendingYOffset; float mPendingXOffsetStep; float mPendingYOffsetStep; boolean mPendingSync; MotionEvent mPendingMove; Loading Loading @@ -227,11 +229,14 @@ public abstract class WallpaperService extends Service { } @Override public void dispatchWallpaperOffsets(float x, float y, boolean sync) { public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) { synchronized (mLock) { if (DEBUG) Log.v(TAG, "Dispatch wallpaper offsets: " + x + ", " + y); mPendingXOffset = x; mPendingYOffset = y; mPendingXOffsetStep = xStep; mPendingYOffsetStep = yStep; if (sync) { mPendingSync = true; } Loading Loading @@ -360,6 +365,7 @@ public abstract class WallpaperService extends Service { * WallpaperManager.setWallpaperOffsets()}. */ public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) { } Loading Loading @@ -608,10 +614,14 @@ public abstract class WallpaperService extends Service { float xOffset; float yOffset; float xOffsetStep; float yOffsetStep; boolean sync; synchronized (mLock) { xOffset = mPendingXOffset; yOffset = mPendingYOffset; xOffsetStep = mPendingXOffsetStep; yOffsetStep = mPendingYOffsetStep; sync = mPendingSync; mPendingSync = false; mOffsetMessageEnqueued = false; Loading @@ -622,7 +632,7 @@ public abstract class WallpaperService extends Service { final int xPixels = availw > 0 ? -(int)(availw*xOffset+.5f) : 0; final int availh = mIWallpaperEngine.mReqHeight-mCurHeight; final int yPixels = availh > 0 ? -(int)(availh*yOffset+.5f) : 0; onOffsetsChanged(xOffset, yOffset, xPixels, yPixels); onOffsetsChanged(xOffset, yOffset, xOffsetStep, yOffsetStep, xPixels, yPixels); if (sync) { try { Loading
core/java/android/view/IWindow.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ oneway interface IWindow { /** * Called for wallpaper windows when their offsets change. */ void dispatchWallpaperOffsets(float x, float y, boolean sync); void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync); Loading