Support uninstalling an app by dragging from all apps to trash can.

This commit is contained in:
Patrick Dubroy
2010-09-01 11:54:27 -07:00
parent c4fb9173e7
commit bc6840b316
3 changed files with 43 additions and 23 deletions
@@ -16,6 +16,7 @@
package com.android.launcher2;
import android.content.ComponentName;
import android.content.Context;
import android.graphics.Paint;
import android.graphics.PorterDuff;
@@ -65,13 +66,13 @@ public class ApplicationInfoDropTarget extends ImageView implements DropTarget,
// in onDrop, because it allows us to reject the drop (by returning false)
// so that the object being dragged isn't removed from the home screen.
String packageName = null;
ComponentName componentName = null;
if (dragInfo instanceof ApplicationInfo) {
packageName = ((ApplicationInfo)dragInfo).componentName.getPackageName();
componentName = ((ApplicationInfo)dragInfo).componentName;
} else if (dragInfo instanceof ShortcutInfo) {
packageName = ((ShortcutInfo)dragInfo).intent.getComponent().getPackageName();
componentName = ((ShortcutInfo)dragInfo).intent.getComponent();
}
mLauncher.startApplicationDetailsActivity(packageName);
mLauncher.startApplicationDetailsActivity(componentName);
return false;
}