summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2010-10-20 18:19:45 -0700
committerMichael Jurka <mikejurka@google.com>2010-10-20 20:00:44 -0700
commit6b4b25d093b0a3008d6e275438c79db9c21daab9 (patch)
tree2aa6dd149d7abf43b86f12e902841d561ed9be12 /src/com
parentdf4b83dd9d6380ab963c62d1f9d1312efc87cb0f (diff)
downloadpackages_apps_trebuchet-6b4b25d093b0a3008d6e275438c79db9c21daab9.zip
packages_apps_trebuchet-6b4b25d093b0a3008d6e275438c79db9c21daab9.tar.gz
packages_apps_trebuchet-6b4b25d093b0a3008d6e275438c79db9c21daab9.tar.bz2
fixed bug with adding items in customize mode
also, no longer mark items as checked in customize mode Bug: 3116708 Change-Id: I01b935ba8bfb450dfab9175a7eb5b7619ad187a6
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/CustomizePagedView.java41
-rw-r--r--src/com/android/launcher2/Launcher.java22
2 files changed, 18 insertions, 45 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index f832b62..cc21276 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -334,35 +334,18 @@ public class CustomizePagedView extends PagedView
}
if (enterChoiceMode) {
- if (v instanceof Checkable) {
- final Checkable c = (Checkable) v;
- final boolean wasChecked = c.isChecked();
- resetCheckedGrandchildren();
- c.setChecked(!wasChecked);
-
- // End the current choice mode when we have no items selected
- /*if (!c.isChecked()) {
- endChoiceMode();
- } else if (isChoiceMode(CHOICE_MODE_NONE)) {
- endChoiceMode();
- startChoiceMode(CHOICE_MODE_SINGLE, this);
- }*/
- mChoiceMode = CHOICE_MODE_SINGLE;
-
- Workspace w = mLauncher.getWorkspace();
- int currentWorkspaceScreen = mLauncher.getCurrentWorkspaceScreen();
- final CellLayout cl = (CellLayout)w.getChildAt(currentWorkspaceScreen);
- cl.setHover(true);
-
- animateClickFeedback(v, new Runnable() {
- @Override
- public void run() {
- cl.setHover(false);
- mLauncher.onWorkspaceClick(cl);
- mChoiceMode = CHOICE_MODE_NONE;
- }
- });
- }
+ final ItemInfo itemInfo = (ItemInfo) v.getTag();
+
+ Workspace w = mLauncher.getWorkspace();
+ int currentWorkspaceScreen = mLauncher.getCurrentWorkspaceScreen();
+ final CellLayout cl = (CellLayout)w.getChildAt(currentWorkspaceScreen);
+
+ animateClickFeedback(v, new Runnable() {
+ @Override
+ public void run() {
+ mLauncher.addExternalItemToScreen(itemInfo, cl);
+ }
+ });
return;
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6fcf432..2688e54 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2669,24 +2669,14 @@ public final class Launcher extends Activity
}
}
- void onWorkspaceClick(CellLayout layout) {
- Object itemInfo = mAllAppsPagedView.getChosenItem();
- if (itemInfo == null) {
- itemInfo = mCustomizePagedView.getChosenItem();
+ void addExternalItemToScreen(ItemInfo itemInfo, CellLayout layout) {
+ if (!mWorkspace.addExternalItemToScreen(itemInfo, layout)) {
+ showOutOfSpaceMessage();
}
+ }
- if (itemInfo == null) {
- // No items are chosen in All Apps or Customize, so just zoom into the workspace
- showWorkspace(true, layout);
- } else {
- // Act as if the chosen item was dropped on the given CellLayout
- if (mWorkspace.addExternalItemToScreen(itemInfo, layout)) {
- mAllAppsPagedView.endChoiceMode();
- mCustomizePagedView.endChoiceMode();
- } else {
- showOutOfSpaceMessage();
- }
- }
+ void onWorkspaceClick(CellLayout layout) {
+ showWorkspace(true, layout);
}
private void updateButtonWithIconFromExternalActivity(