mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Call close for AbstractFloatingViews that were removed while still open.
I'm not sure how/when this case occurs (perhaps during some transition/state change), but manually removing the floating view matches the symptoms in the bug. Bug: 72996404 Change-Id: I1e7c1a338fcd16c8e07b3c49fb9c9b2097eb2708
This commit is contained in:
@@ -34,6 +34,8 @@ import com.android.launcher3.util.TouchController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
|
||||
|
||||
/**
|
||||
* A viewgroup with utility methods for drag-n-drop and touch interception
|
||||
*/
|
||||
@@ -118,6 +120,21 @@ public abstract class BaseDragLayer<T extends BaseDraggingActivity> extends Inse
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRemoved(View child) {
|
||||
super.onViewRemoved(child);
|
||||
if (child instanceof AbstractFloatingView) {
|
||||
// Handles the case where the view is removed without being properly closed.
|
||||
// This can happen if something goes wrong during a state change/transition.
|
||||
postDelayed(() -> {
|
||||
AbstractFloatingView floatingView = (AbstractFloatingView) child;
|
||||
if (floatingView.isOpen()) {
|
||||
floatingView.close(false);
|
||||
}
|
||||
}, SINGLE_FRAME_MS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
int action = ev.getAction();
|
||||
|
||||
Reference in New Issue
Block a user