diff options
-rw-r--r-- | res/values/dimens.xml | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 24 | ||||
-rw-r--r-- | src/com/android/launcher2/Cling.java | 24 | ||||
-rw-r--r-- | src/com/android/launcher2/PagedViewWidget.java | 2 |
4 files changed, 13 insertions, 39 deletions
diff --git a/res/values/dimens.xml b/res/values/dimens.xml index fa85a1b16..e789fdf33 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -22,8 +22,6 @@ <dimen name="cling_text_block_offset_x">0dp</dimen> <dimen name="cling_text_block_offset_y">0dp</dimen> <dimen name="reveal_radius">48dp</dimen> - <!-- A list of custom punch through x,y coordinates. x and y alternate. default to empty. --> - <array name="punch_through_coords"></array> <!-- Workspace --> <!-- qsb_bar_height_inset represents qsb_bar_height minus the padding diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 4712a37b8..5e0d43dcc 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,16 +651,12 @@ 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); } } 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); @@ -675,23 +665,21 @@ 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; } - // 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; - } - // 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; diff --git a/src/com/android/launcher2/Cling.java b/src/com/android/launcher2/Cling.java index 6f2d02116..797829846 100644 --- a/src/com/android/launcher2/Cling.java +++ b/src/com/android/launcher2/Cling.java @@ -62,7 +62,6 @@ public class Cling extends FrameLayout { private int mButtonBarHeight; private float mRevealRadius; private int[] mPositionData; - private int[] mCustomPositionData; private Paint mErasePaint; @@ -89,17 +88,6 @@ public class Cling extends FrameLayout { Resources r = getContext().getResources(); - // If we have custom punch through data from resources - TypedArray punchThroughCoords = r.obtainTypedArray(R.array.punch_through_coords); - - if (punchThroughCoords != null) { - int len = punchThroughCoords.length(); - mCustomPositionData = new int[len]; - for (int i = 0; i < len; i++) { - mCustomPositionData[i] = punchThroughCoords.getDimensionPixelSize(i, 0); - } - } - mPunchThroughGraphic = r.getDrawable(R.drawable.cling); mPunchThroughGraphicCenterRadius = r.getDimensionPixelSize(R.dimen.clingPunchThroughGraphicCenterRadius); @@ -133,8 +121,6 @@ public class Cling extends FrameLayout { final int cornerXOffset = (int) (scale * 15); final int cornerYOffset = (int) (scale * 10); return new int[]{getMeasuredWidth() - cornerXOffset, cornerYOffset}; - } else if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { - return mCustomPositionData; } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) || mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) || mDrawIdentifier.equals(ALLAPPS_LARGE)) { @@ -148,7 +134,6 @@ public class Cling extends FrameLayout { if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || mDrawIdentifier.equals(WORKSPACE_LARGE) || - mDrawIdentifier.equals(WORKSPACE_CUSTOM) || mDrawIdentifier.equals(ALLAPPS_PORTRAIT) || mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) || mDrawIdentifier.equals(ALLAPPS_LARGE)) { @@ -172,6 +157,9 @@ public class Cling extends FrameLayout { return false; } } + } else if (mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { + // Let all touch events fall through + return false; } return true; }; @@ -191,15 +179,15 @@ public class Cling extends FrameLayout { if (mBackground == null) { if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) || - mDrawIdentifier.equals(WORKSPACE_LARGE) || - mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { + mDrawIdentifier.equals(WORKSPACE_LARGE)) { mBackground = getResources().getDrawable(R.drawable.bg_cling1); } else if (mDrawIdentifier.equals(ALLAPPS_PORTRAIT) || mDrawIdentifier.equals(ALLAPPS_LANDSCAPE) || mDrawIdentifier.equals(ALLAPPS_LARGE)) { mBackground = getResources().getDrawable(R.drawable.bg_cling2); } else if (mDrawIdentifier.equals(FOLDER_PORTRAIT) || - mDrawIdentifier.equals(FOLDER_LANDSCAPE)) { + mDrawIdentifier.equals(FOLDER_LANDSCAPE) || + mDrawIdentifier.equals(WORKSPACE_CUSTOM)) { mBackground = getResources().getDrawable(R.drawable.bg_cling3); } else if (mDrawIdentifier.equals(FOLDER_LARGE)) { mBackground = getResources().getDrawable(R.drawable.bg_cling4); diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java index a6ea78f46..e89414254 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; } } |