mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Cleaning up some spring-loaded related dragging code. Allow cancel spring loaded mode.
Change-Id: Ie1f0468c563bed7abc1aa6416e222cdb0853c03a
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user