summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Launcher.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-05-26 12:03:43 -0700
committerWinson Chung <winsonc@google.com>2011-05-26 15:03:07 -0700
commit55b6550e37da5df2fda44fc712bc082731f2d8e7 (patch)
tree4003df523f68b268838759381258def2976a45fe /src/com/android/launcher2/Launcher.java
parented4c1f1eaddd23ea3a19750533e84d7411334534 (diff)
downloadandroid_packages_apps_Trebuchet-55b6550e37da5df2fda44fc712bc082731f2d8e7.tar.gz
android_packages_apps_Trebuchet-55b6550e37da5df2fda44fc712bc082731f2d8e7.tar.bz2
android_packages_apps_Trebuchet-55b6550e37da5df2fda44fc712bc082731f2d8e7.zip
Changing long-press-on-workspace behaviour to show Applications & Widgets.
- Disabling tap-on-widgets-to-add in favour of long press Change-Id: Ia82143b74216a968ab11890cba83a01c4ab72a06
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r--src/com/android/launcher2/Launcher.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 2a16e9978..f8d341198 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2230,11 +2230,7 @@ public final class Launcher extends Activity
mWorkspace.setAllowLongPress(false);
mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
- if (LauncherApplication.isScreenLarge()) {
- addItems();
- } else {
- startWallpaper();
- }
+ addItems();
} else {
if (!(itemUnderLongClick instanceof Folder)) {
// User long pressed on an item
@@ -2970,9 +2966,8 @@ public final class Launcher extends Activity
// Change the state *after* we've called all the transition code
mState = State.ALL_APPS;
} else {
- View appsCustomizePane = findViewById(R.id.apps_customize_pane);
cameraZoomOut(State.APPS_CUSTOMIZE, animated, false);
- appsCustomizePane.requestFocus();
+ mAppsCustomizeTabHost.requestFocus();
// Change the state *after* we've called all the transition code
mState = State.APPS_CUSTOMIZE;
@@ -3242,12 +3237,11 @@ public final class Launcher extends Activity
Dialog createDialog() {
mAdapter = new AddAdapter(Launcher.this);
- final AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(Launcher.this,
+ AlertDialog.THEME_HOLO_DARK);
builder.setTitle(getString(R.string.menu_item_add_item));
builder.setAdapter(mAdapter, this);
- builder.setInverseBackgroundForced(true);
-
AlertDialog dialog = builder.create();
dialog.setOnCancelListener(this);
dialog.setOnDismissListener(this);
@@ -3262,6 +3256,8 @@ public final class Launcher extends Activity
}
public void onDismiss(DialogInterface dialog) {
+ mWaitingForResult = false;
+ cleanup();
}
private void cleanup() {
@@ -3279,22 +3275,26 @@ public final class Launcher extends Activity
Resources res = getResources();
cleanup();
- switch (which) {
+ AddAdapter.ListItem item = (AddAdapter.ListItem) mAdapter.getItem(which);
+ switch (item.actionTag) {
case AddAdapter.ITEM_SHORTCUT: {
pickShortcut();
break;
}
-
+ case AddAdapter.ITEM_APPLICATION: {
+ if (mAppsCustomizeTabHost != null) {
+ mAppsCustomizeTabHost.selectAppsTab();
+ }
+ showAllApps(true);
+ break;
+ }
case AddAdapter.ITEM_APPWIDGET: {
- int appWidgetId = Launcher.this.mAppWidgetHost.allocateAppWidgetId();
-
- Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
- pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
- // start the pick activity
- startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
+ if (mAppsCustomizeTabHost != null) {
+ mAppsCustomizeTabHost.selectWidgetsTab();
+ }
+ showAllApps(true);
break;
}
-
case AddAdapter.ITEM_WALLPAPER: {
startWallpaper();
break;