Fix issue with spring loaded mode

Bug # 3373320
This commit is contained in:
Michael Jurka
2011-01-26 00:00:44 -08:00
parent 5cc7c35dca
commit 0bb8563b13
2 changed files with 38 additions and 6 deletions

View File

@@ -26,6 +26,8 @@ public class SpringLoadedDragController implements OnAlarmListener {
// the screen the user is currently hovering over, if any
private CellLayout mScreen;
private Launcher mLauncher;
boolean mFinishedAnimation = false;
boolean mWaitingToReenter = false;
public SpringLoadedDragController(Launcher launcher) {
mLauncher = launcher;
@@ -33,9 +35,16 @@ public class SpringLoadedDragController implements OnAlarmListener {
mAlarm.setOnAlarmListener(this);
}
public void onDragEnter(CellLayout cl) {
public void onDragEnter(CellLayout cl, boolean isSpringLoaded) {
mScreen = cl;
mAlarm.setAlarm(ENTER_SPRING_LOAD_HOVER_TIME);
mFinishedAnimation = isSpringLoaded;
mWaitingToReenter = false;
}
public void onEnterSpringLoadedMode(boolean waitToReenter) {
mFinishedAnimation = true;
mWaitingToReenter = waitToReenter;
}
public void onDragExit() {
@@ -43,7 +52,9 @@ public class SpringLoadedDragController implements OnAlarmListener {
mScreen.onDragExit();
}
mScreen = null;
mAlarm.setAlarm(EXIT_SPRING_LOAD_HOVER_TIME);
if (mFinishedAnimation && !mWaitingToReenter) {
mAlarm.setAlarm(EXIT_SPRING_LOAD_HOVER_TIME);
}
}
// this is called when our timer runs out