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
+13 -1
View File
@@ -1765,12 +1765,21 @@ public final class Launcher extends Activity
}
}
void startApplicationDetailsActivity(String packageName) {
void startApplicationDetailsActivity(ComponentName componentName) {
String packageName = componentName.getPackageName();
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", packageName, null));
startActivity(intent);
}
void startApplicationUninstallActivity(ComponentName componentName) {
String packageName = componentName.getPackageName();
String className = componentName.getClassName();
Intent intent = new Intent(
Intent.ACTION_DELETE, Uri.fromParts("package", packageName, className));
startActivity(intent);
}
void startActivitySafely(Intent intent, Object tag) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
@@ -2277,18 +2286,21 @@ public final class Launcher extends Activity
hideOrShowToolbarButton(true, allAppsButton, showSeq);
hideOrShowToolbarButton(true, configureButton, showSeq);
hideOrShowToolbarButton(false, marketButton, hideSeq);
mDeleteZone.setHandle(allAppsButton);
break;
case ALL_APPS:
hideOrShowToolbarButton(true, configureButton, showSeq);
hideOrShowToolbarButton(true, marketButton, showSeq);
hideOrShowToolbarButton(false, searchButton, hideSeq);
hideOrShowToolbarButton(false, allAppsButton, hideSeq);
mDeleteZone.setHandle(marketButton);
break;
case CUSTOMIZE:
hideOrShowToolbarButton(true, allAppsButton, showSeq);
hideOrShowToolbarButton(false, searchButton, hideSeq);
hideOrShowToolbarButton(false, marketButton, hideSeq);
hideOrShowToolbarButton(false, configureButton, hideSeq);
mDeleteZone.setHandle(allAppsButton);
break;
}
}