Cleaning up some spring-loaded related dragging code. Allow cancel spring loaded mode.

Change-Id: Ie1f0468c563bed7abc1aa6416e222cdb0853c03a
This commit is contained in:
Winson Chung
2011-07-01 15:35:26 -07:00
parent d044526d82
commit c07918d005
9 changed files with 219 additions and 215 deletions

View File

@@ -40,6 +40,7 @@ public class SpringLoadedDragController implements OnAlarmListener {
// Set a new alarm to expire for the screen that we are hovering over now
public void setAlarm(CellLayout cl) {
if (mScreen != cl) {
mAlarm.cancelAlarm();
mAlarm.setAlarm(ENTER_SPRING_LOAD_HOVER_TIME);
}
mScreen = cl;
@@ -52,6 +53,8 @@ public class SpringLoadedDragController implements OnAlarmListener {
Workspace w = mLauncher.getWorkspace();
int page = w.indexOfChild(mScreen);
w.snapToPage(page);
} else {
mLauncher.getDragController().cancelDrag();
}
}
}