summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-03-23 15:59:27 -0700
committerWinson Chung <winsonc@google.com>2012-03-26 10:55:49 -0700
commit93eef082ec2da802ee4507fb2ca729e550f833f1 (patch)
treebe2f68b053874dfdf967aea9a498ff110cd3a993 /src
parent568c659352cfe6c3ff87d294f8b8df9bc8f55335 (diff)
downloadandroid_packages_apps_Trebuchet-93eef082ec2da802ee4507fb2ca729e550f833f1.tar.gz
android_packages_apps_Trebuchet-93eef082ec2da802ee4507fb2ca729e550f833f1.tar.bz2
android_packages_apps_Trebuchet-93eef082ec2da802ee4507fb2ca729e550f833f1.zip
Making the text reflect the container when you are unable to drop onto a space.
Change-Id: Ib3734b7f7767bdf0fb4c95dcc1298da02c04e9cd
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java2
-rw-r--r--src/com/android/launcher2/Launcher.java13
-rw-r--r--src/com/android/launcher2/Workspace.java7
3 files changed, 12 insertions, 10 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 039ee8aaf..986e8528b 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -791,7 +791,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
if (showOutOfSpaceMessage) {
- mLauncher.showOutOfSpaceMessage();
+ mLauncher.showOutOfSpaceMessage(false);
}
d.deferDragViewCleanupPostAnimation = false;
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 9494d2792..6464a7d78 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -881,7 +881,7 @@ public final class Launcher extends Activity
cellXY[0] = cellX;
cellXY[1] = cellY;
} else if (!layout.findCellForSpan(cellXY, 1, 1)) {
- showOutOfSpaceMessage();
+ showOutOfSpaceMessage(isHotseatLayout(layout));
return;
}
@@ -944,7 +944,7 @@ public final class Launcher extends Activity
}
if (!foundCellSpan) {
- showOutOfSpaceMessage();
+ showOutOfSpaceMessage(isHotseatLayout(layout));
return;
}
@@ -1039,7 +1039,7 @@ public final class Launcher extends Activity
}
}.start();
}
- showOutOfSpaceMessage();
+ showOutOfSpaceMessage(isHotseatLayout(layout));
return;
}
@@ -1225,8 +1225,9 @@ public final class Launcher extends Activity
launcherInfo.hostView = null;
}
- void showOutOfSpaceMessage() {
- Toast.makeText(this, getString(R.string.out_of_space), Toast.LENGTH_SHORT).show();
+ void showOutOfSpaceMessage(boolean isHotseatLayout) {
+ int strId = (isHotseatLayout ? R.string.hotseat_out_of_space : R.string.out_of_space);
+ Toast.makeText(this, getString(strId), Toast.LENGTH_SHORT).show();
}
public LauncherAppWidgetHost getAppWidgetHost() {
@@ -2751,7 +2752,7 @@ public final class Launcher extends Activity
*/
void addExternalItemToScreen(ItemInfo itemInfo, final CellLayout layout) {
if (!mWorkspace.addExternalItemToScreen(itemInfo, layout)) {
- showOutOfSpaceMessage();
+ showOutOfSpaceMessage(isHotseatLayout(layout));
}
}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index f1941b31c..5c8694dcd 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2064,7 +2064,8 @@ public class Workspace extends SmoothPagedView
if (!foundCell) {
// Don't show the message if we are dropping on the AllApps button and the hotseat
// is full
- if (mTargetCell != null && mLauncher.isHotseatLayout(mDragTargetLayout)) {
+ boolean isHotseat = mLauncher.isHotseatLayout(mDragTargetLayout);
+ if (mTargetCell != null && isHotseat) {
Hotseat hotseat = mLauncher.getHotseat();
if (hotseat.isAllAppsButtonRank(
hotseat.getOrderInHotseat(mTargetCell[0], mTargetCell[1]))) {
@@ -2072,7 +2073,7 @@ public class Workspace extends SmoothPagedView
}
}
- mLauncher.showOutOfSpaceMessage();
+ mLauncher.showOutOfSpaceMessage(isHotseat);
return false;
}
}
@@ -2943,7 +2944,7 @@ public class Workspace extends SmoothPagedView
onDropExternal(dragInfo.dropPos, (ItemInfo) dragInfo, (CellLayout) layout, false);
return true;
}
- mLauncher.showOutOfSpaceMessage();
+ mLauncher.showOutOfSpaceMessage(mLauncher.isHotseatLayout(layout));
return false;
}