diff options
author | Winson Chung <winsonc@google.com> | 2011-11-17 14:58:51 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-11-18 10:13:04 -0800 |
commit | 3f4e1423804d64a38cb69e4511d7b80783564827 (patch) | |
tree | 005900e0f74f6c4cecd43a594df46141a31b7276 /src/com/android/launcher2/AppsCustomizePagedView.java | |
parent | b0736fac73b0df95f18234a0494aea3f3fc6c735 (diff) | |
download | packages_apps_trebuchet-3f4e1423804d64a38cb69e4511d7b80783564827.zip packages_apps_trebuchet-3f4e1423804d64a38cb69e4511d7b80783564827.tar.gz packages_apps_trebuchet-3f4e1423804d64a38cb69e4511d7b80783564827.tar.bz2 |
Minor fixes to Launcher
- Tweaking the AllApps tab padding
- Fixing issue where the cling punch out might be in the wrong location
- Removing unused dragging code related to drop/scroll area overlap
- Tweaking padding so that picking up an icon on the top row does not automatically hover over delete (Bug 5636264)
- Fixing issue where multiple bgs in AllApps tab bar line makes it look blurry (Bug 5523822)
Change-Id: I707397c231188a9feee8c0856374e0483cf37296
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizePagedView.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 2cdd16a..0189d6c 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -193,6 +193,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen private ArrayList<Object> mWidgets; // Cling + private boolean mHasShownAllAppsCling; private int mClingFocusedX; private int mClingFocusedY; @@ -396,14 +397,33 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen int page = getPageForComponent(mSaveInstanceStateItemIndex); invalidatePageData(Math.max(0, page)); - // Calculate the position for the cling punch through - int[] offset = new int[2]; - int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY); - mLauncher.getDragLayer().getLocationInDragLayer(this, offset); - pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + offset[0]; - pos[1] += (getMeasuredHeight() - mWidgetSpacingLayout.getMeasuredHeight()) / 2 + offset[1]; - mLauncher.showFirstRunAllAppsCling(pos); + // Show All Apps cling if we are finished transitioning, otherwise, we will try again when + // the transition completes in AppsCustomizeTabHost (otherwise the wrong offsets will be + // returned while animating) + AppsCustomizeTabHost host = (AppsCustomizeTabHost) getTabHost(); + if (!host.isTransitioning()) { + post(new Runnable() { + @Override + public void run() { + showAllAppsCling(); + } + }); + } + } + void showAllAppsCling() { + if (!mHasShownAllAppsCling && isDataReady() && testDataReady()) { + mHasShownAllAppsCling = true; + // Calculate the position for the cling punch through + int[] offset = new int[2]; + int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY); + mLauncher.getDragLayer().getLocationInDragLayer(this, offset); + // PagedViews are centered horizontally but top aligned + pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + + offset[0]; + pos[1] += offset[1]; + mLauncher.showFirstRunAllAppsCling(pos); + } } @Override |