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
This commit is contained in:
Winson Chung
2011-11-17 14:58:51 -08:00
parent b0736fac73
commit 3f4e142380
11 changed files with 64 additions and 49 deletions
@@ -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