mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Fix issue with spring loaded mode
Bug # 3373320
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user