mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Fixing crash when you are dragging an app and the packages change under you. (Bug: 5280181)
- Removing unused dimension for app icon content size Change-Id: If3910010577e902937d284296479f9a699516de3
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.launcher2;
|
||||
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.appwidget.AppWidgetProviderInfo;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
@@ -367,6 +369,21 @@ public class DragController {
|
||||
}
|
||||
endDrag();
|
||||
}
|
||||
public void onAppsRemoved(ArrayList<ApplicationInfo> apps, Context context) {
|
||||
// Cancel the current drag if we are removing an app that we are dragging
|
||||
if (mDragObject != null) {
|
||||
Object rawDragInfo = mDragObject.dragInfo;
|
||||
if (rawDragInfo instanceof ShortcutInfo) {
|
||||
ShortcutInfo dragInfo = (ShortcutInfo) rawDragInfo;
|
||||
for (ApplicationInfo info : apps) {
|
||||
if (dragInfo.intent.getComponent().equals(info.intent.getComponent())) {
|
||||
cancelDrag();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void endDrag() {
|
||||
if (mDragging) {
|
||||
|
||||
Reference in New Issue
Block a user