Add support for MoveTo.

This commit is contained in:
Jason Sams
2009-10-19 14:45:45 -07:00
parent 37e7c2b6e4
commit c1c521edf4
2 changed files with 43 additions and 0 deletions

View File

@@ -482,9 +482,11 @@ public class AllAppsView extends RSSurfaceView
private Resources mRes;
private Script mScript;
private Script.Invokable mInvokeMove;
private Script.Invokable mInvokeMoveTo;
private Script.Invokable mInvokeFling;
private Script.Invokable mInvokeResetWAR;
private ProgramStore mPSIcons;
private ProgramStore mPSText;
private ProgramFragment mPFColor;
@@ -570,6 +572,7 @@ public class AllAppsView extends RSSurfaceView
public int selectedIconTexture;
public float zoomTarget;
public int homeButtonId;
public float targetPos;
State() {
mType = Type.createFromClass(mRS, State.class, 1, "StateClass");
@@ -743,6 +746,7 @@ public class AllAppsView extends RSSurfaceView
sb.setType(mState.mType, "state", Defines.ALLOC_STATE);
mInvokeMove = sb.addInvokable("move");
mInvokeFling = sb.addInvokable("fling");
mInvokeMoveTo = sb.addInvokable("moveTo");
mInvokeResetWAR = sb.addInvokable("resetHWWar");
mScript = sb.create();
mScript.setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
@@ -937,6 +941,12 @@ public class AllAppsView extends RSSurfaceView
mInvokeMove.execute();
}
void moveTo(float row) {
mState.targetPos = row;
mState.save();
mInvokeMoveTo.execute();
}
/**
* You need to call save() on mState on your own after calling this.
*