From 5212e51649c0754412c607d5a0f7bf896237f944 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Thu, 17 May 2012 12:24:40 -0700 Subject: [PATCH 1/4] Removing logging related to and fixing (issue 6238330) Change-Id: I7ed89840d90fd13cbfedc795e789706b32f76b5d --- src/com/android/launcher2/AppsCustomizePagedView.java | 10 ---------- src/com/android/launcher2/PagedViewWidget.java | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 4712a37b8b..618d62e55f 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -614,24 +614,18 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen @Override public void onShortPress(View v) { - Log.d(TAG, "onShortPress, view: " + v); // We are anticipating a long press, and we use this time to load bind and instantiate // the widget. This will need to be cleaned up if it turns out no long press occurs. if (mCreateWidgetInfo != null) { - Log.d(TAG, "onShortPress --> cleanup previous, view: " + v + ", create info: " + mCreateWidgetInfo); // Just in case the cleanup process wasn't properly executed. This shouldn't happen. cleanupWidgetPreloading(false); } mCreateWidgetInfo = new PendingAddWidgetInfo((PendingAddWidgetInfo) v.getTag()); - Log.d(TAG, "onShortPress --> create widget info: " + mCreateWidgetInfo); preloadWidget(mCreateWidgetInfo); } private void cleanupWidgetPreloading(boolean widgetWasAdded) { - Log.d(TAG, "cleanup widget preloading"); - if (!widgetWasAdded) { - Log.d(TAG, "cleanup widget preloading --> widget wasn't added"); // If the widget was not added, we may need to do further cleanup. PendingAddWidgetInfo info = mCreateWidgetInfo; mCreateWidgetInfo = null; @@ -657,9 +651,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen @Override public void cleanUpShortPress(View v) { - Log.d(TAG, "cleanup shortpress, view: " + v); if (!mDraggingWidget) { - Log.d(TAG, "cleanup shortpress --> cleanup preloading"); cleanupWidgetPreloading(false); } } @@ -675,7 +667,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // If the ImageView doesn't have a drawable yet, the widget preview hasn't been loaded and // we abort the drag. if (image.getDrawable() == null) { - Log.d(TAG, "begin dragging widget, no drawable"); mDraggingWidget = false; return false; } @@ -683,7 +674,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // This can happen in some weird cases involving multi-touch. We can't start dragging the // widget if this is null, so we break out. if (mCreateWidgetInfo == null) { - Log.d(TAG, "begin dragging widget, create widget info null"); return false; } diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java index a6ea78f46c..e89414254a 100644 --- a/src/com/android/launcher2/PagedViewWidget.java +++ b/src/com/android/launcher2/PagedViewWidget.java @@ -144,8 +144,8 @@ public class PagedViewWidget extends LinearLayout { if (sShortpressTarget != null) return; if (mShortPressListener != null) { mShortPressListener.onShortPress(PagedViewWidget.this); + sShortpressTarget = PagedViewWidget.this; } - sShortpressTarget = PagedViewWidget.this; mShortPressTriggered = true; } } From 98a72fbb08f30fe9d42555460c453e4d438867f5 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Thu, 17 May 2012 13:43:29 -0700 Subject: [PATCH 2/4] Fixing regression where you can't add shortcuts Change-Id: I2c91a9a5131591aa15319efdaf887f06fb593b08 --- .../android/launcher2/AppsCustomizePagedView.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 618d62e55f..5e0d43dcc1 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -657,8 +657,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } private boolean beginDraggingWidget(View v) { - Log.d(TAG, "begin dragging widget, view: " + v); - mDraggingWidget = true; // Get the widget preview as the drag representation ImageView image = (ImageView) v.findViewById(R.id.widget_preview); @@ -671,17 +669,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen return false; } - // This can happen in some weird cases involving multi-touch. We can't start dragging the - // widget if this is null, so we break out. - if (mCreateWidgetInfo == null) { - return false; - } - // Compose the drag image Bitmap preview; Bitmap outline; float scale = 1f; if (createItemInfo instanceof PendingAddWidgetInfo) { + // This can happen in some weird cases involving multi-touch. We can't start dragging + // the widget if this is null, so we break out. + if (mCreateWidgetInfo == null) { + return false; + } + PendingAddWidgetInfo createWidgetInfo = mCreateWidgetInfo; createItemInfo = createWidgetInfo; int spanX = createItemInfo.spanX; From 99838b84078f0f787c488ee8ffafafad7f76bbe2 Mon Sep 17 00:00:00 2001 From: Andrew Flynn Date: Thu, 17 May 2012 13:37:52 -0700 Subject: [PATCH 3/4] Change custom workspace cling Change-Id: I8fe44469ac4bf38f9be2228d8eace1198bf3a48e --- res/values/dimens.xml | 2 -- src/com/android/launcher2/Cling.java | 24 ++++++------------------ 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/res/values/dimens.xml b/res/values/dimens.xml index fa85a1b160..e789fdf33f 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -22,8 +22,6 @@ 0dp 0dp 48dp - -