diff --git a/res/drawable/tab_widget_indicator_selector.xml b/res/drawable/tab_widget_indicator_selector.xml index ff92b4048a..d06f757ceb 100644 --- a/res/drawable/tab_widget_indicator_selector.xml +++ b/res/drawable/tab_widget_indicator_selector.xml @@ -16,7 +16,6 @@ - diff --git a/res/layout-sw600dp/market_button.xml b/res/layout-sw600dp/market_button.xml index 3f313190f8..4ccecd92c9 100644 --- a/res/layout-sw600dp/market_button.xml +++ b/res/layout-sw600dp/market_button.xml @@ -19,8 +19,8 @@ style="@style/MarketButton" android:onClick="onClickAppMarketButton" android:gravity="center" - android:paddingLeft="10dp" - android:paddingRight="10dp" + android:paddingLeft="32dp" + android:paddingRight="32dp" android:drawablePadding="10dp" android:text="@string/market" android:contentDescription="@string/market" @@ -32,6 +32,5 @@ android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="2.0" - android:background="@drawable/tab_widget_indicator_selector" android:focusable="true" android:clickable="true" /> diff --git a/res/layout/market_button.xml b/res/layout/market_button.xml index 2d840d7313..5e1015631f 100644 --- a/res/layout/market_button.xml +++ b/res/layout/market_button.xml @@ -19,13 +19,12 @@ style="@style/MarketButton" android:onClick="onClickAppMarketButton" android:gravity="center" - android:paddingLeft="@dimen/toolbar_button_horizontal_padding" - android:paddingRight="@dimen/toolbar_button_horizontal_padding" + android:paddingLeft="16dp" + android:paddingRight="16dp" android:contentDescription="@string/market" android:shadowColor="@color/workspace_all_apps_and_delete_zone_text_shadow_color" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="2.0" - android:background="@drawable/tab_widget_indicator_selector" android:focusable="true" android:clickable="true" /> diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml index bb155bdf66..7949d2d347 100644 --- a/res/values-land/styles.xml +++ b/res/values-land/styles.xml @@ -65,10 +65,5 @@ 1.0 4.0 - - diff --git a/res/values-sw340dp/dimens.xml b/res/values-sw340dp/dimens.xml new file mode 100644 index 0000000000..69d6e58a3b --- /dev/null +++ b/res/values-sw340dp/dimens.xml @@ -0,0 +1,20 @@ + + + + + + 20dp + diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml index 70e24be061..1905fad4ae 100644 --- a/res/values-sw600dp/styles.xml +++ b/res/values-sw600dp/styles.xml @@ -79,10 +79,8 @@ 13sp @@ -124,8 +122,8 @@ center center_vertical 7.5dp - 25dp - 25dp + 60dp + 60dp #FFFFFFFF 16sp #393939 diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 87c9be8d92..a744ccefb2 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -79,9 +79,6 @@ 0dp 70dp - - 40dp - 0dip @@ -91,6 +88,9 @@ 30dip 60dip + + 14dp + 8dip diff --git a/res/values/styles.xml b/res/values/styles.xml index ddbdb349f0..502a8368c3 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -161,8 +161,8 @@ wrap_content match_parent center - 30dp - 30dp + 24dp + 24dp @drawable/tab_widget_indicator_selector ?android:attr/textColorPrimary 12sp diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 2cdd16a49d..0189d6c358 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 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 diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 897a7fb517..778d6bc752 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -388,8 +388,9 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona } if (!toWorkspace) { - // Dismiss the cling if necessary + // Dismiss the workspace cling and show the all apps cling (if not already shown) l.dismissWorkspaceCling(null); + mAppsCustomizePane.showAllAppsCling(); if (!LauncherApplication.isScreenLarge()) { mAppsCustomizePane.hideScrollingIndicator(false); diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index ee054abcc1..286e2fe6d0 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -101,7 +101,6 @@ public class DragController { private int mScrollState = SCROLL_OUTSIDE_ZONE; private ScrollRunnable mScrollRunnable = new ScrollRunnable(); - private RectF mDeleteRegion; private DropTarget mLastDropTarget; private InputMethodManager mInputMethodManager; @@ -486,12 +485,6 @@ public class DragController { } mLastDropTarget = dropTarget; - // Scroll, maybe, but not if we're in the delete region. - boolean inDeleteRegion = false; - if (mDeleteRegion != null) { - inDeleteRegion = mDeleteRegion.contains(x, y); - } - // After a scroll, the touch point will still be in the scroll region. // Rather than scrolling immediately, require a bit of twiddling to scroll again final int slop = ViewConfiguration.get(mLauncher).getScaledWindowTouchSlop(); @@ -500,7 +493,7 @@ public class DragController { mLastTouch[0] = x; mLastTouch[1] = y; - if (!inDeleteRegion && x < mScrollZone) { + if (x < mScrollZone) { if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) { mScrollState = SCROLL_WAITING_IN_ZONE; if (mDragScroller.onEnterScrollArea(x, y, SCROLL_LEFT)) { @@ -508,7 +501,7 @@ public class DragController { mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY); } } - } else if (!inDeleteRegion && x > mScrollView.getWidth() - mScrollZone) { + } else if (x > mScrollView.getWidth() - mScrollZone) { if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) { mScrollState = SCROLL_WAITING_IN_ZONE; if (mDragScroller.onEnterScrollArea(x, y, SCROLL_RIGHT)) { @@ -669,15 +662,6 @@ public class DragController { mScrollView = v; } - /** - * Specifies the delete region. We won't scroll on touch events over the delete region. - * - * @param region The rectangle in DragLayer coordinates of the delete region. - */ - void setDeleteRegion(RectF region) { - mDeleteRegion = region; - } - DragView getDragView() { return mDragObject.dragView; }