summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-10-31 22:31:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-31 22:31:06 +0000
commit8590ecd29a7de85700de662a0723970e9cf884af (patch)
treeb74f9e255678ec9e85aab2ba77dda91240a3b924
parent87752940206f1b576e6e814d3970ba274a84ffde (diff)
parent917e38851cbc6caffe1f8dade4db452bace522ba (diff)
downloadandroid_packages_apps_Trebuchet-8590ecd29a7de85700de662a0723970e9cf884af.tar.gz
android_packages_apps_Trebuchet-8590ecd29a7de85700de662a0723970e9cf884af.tar.bz2
android_packages_apps_Trebuchet-8590ecd29a7de85700de662a0723970e9cf884af.zip
Merge "Fix issue with adding widget with config activity to empty screen (issue 11381059)" into jb-ub-now-jetsonic
-rw-r--r--src/com/android/launcher3/CellLayout.java9
-rw-r--r--src/com/android/launcher3/Launcher.java4
-rw-r--r--src/com/android/launcher3/Workspace.java3
3 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index bf1e9c931..df16d4194 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -76,6 +76,7 @@ public class CellLayout extends ViewGroup {
private int mHeightGap;
private int mMaxGap;
private boolean mScrollingTransformsDirty = false;
+ private boolean mDropPending = false;
private final Rect mRect = new Rect();
private final CellInfo mCellInfo = new CellInfo();
@@ -332,6 +333,14 @@ public class CellLayout extends ViewGroup {
mShortcutsAndWidgets.setInvertIfRtl(invert);
}
+ public void setDropPending(boolean pending) {
+ mDropPending = pending;
+ }
+
+ public boolean isDropPending() {
+ return mDropPending;
+ }
+
private void invalidateBubbleTextView(BubbleTextView icon) {
final int padding = icon.getPressedOrFocusedBackgroundPadding();
invalidate(icon.getLeft() + getPaddingLeft() - padding,
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index f721571c2..3290d8e02 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -754,10 +754,14 @@ public class Launcher extends Activity
};
} else {
result = resultCode;
+ final CellLayout dropLayout =
+ (CellLayout) mWorkspace.getScreenWithId(mPendingAddInfo.screenId);
+ dropLayout.setDropPending(true);
onComplete = new Runnable() {
@Override
public void run() {
completeTwoStageWidgetDrop(result, appWidgetId);
+ dropLayout.setDropPending(false);
}
};
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 3cf77fa01..8c2c89d75 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -671,7 +671,8 @@ public class Workspace extends SmoothPagedView
CellLayout finalScreen = mWorkspaceScreens.get(finalScreenId);
// If the final screen is empty, convert it to the extra empty screen
- if (finalScreen.getShortcutsAndWidgets().getChildCount() == 0) {
+ if (finalScreen.getShortcutsAndWidgets().getChildCount() == 0 &&
+ !finalScreen.isDropPending()) {
mWorkspaceScreens.remove(finalScreenId);
mScreenOrder.remove(finalScreenId);