diff options
author | Allan Wojciechowski <allanwoj@google.com> | 2013-09-12 10:48:23 +0100 |
---|---|---|
committer | Sandeep Siddhartha <sansid@google.com> | 2013-09-13 16:17:22 -0700 |
commit | af110e8603b2f372286d9155cbe8955a6a329e2d (patch) | |
tree | f017196be7c4d6e1c1370f9971192d02077d61cc /src/com/android/launcher3/Workspace.java | |
parent | d6214a7a639ef0cb70467c75cd09737c05589e1f (diff) | |
download | android_packages_apps_Trebuchet-af110e8603b2f372286d9155cbe8955a6a329e2d.tar.gz android_packages_apps_Trebuchet-af110e8603b2f372286d9155cbe8955a6a329e2d.tar.bz2 android_packages_apps_Trebuchet-af110e8603b2f372286d9155cbe8955a6a329e2d.zip |
WIP: Add moveToCustomContentScreen method
To allow as to move to the -1 screen from GEL. Also added a
showWorkspace method to handle intents when we are in All Apps.
Related GEL CL at ag/357408
Change-Id: I0a4d03df2bf035d342b74f6c3c9b3fe9105f1c59
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index ee4bf664a..672a38717 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1333,7 +1333,7 @@ public class Workspace extends SmoothPagedView } private void updateStateForCustomContent(int screenCenter) { - if (hasCustomContent() && !isSmall() && !isSwitchingState()) { + if (hasCustomContent()) { int index = mScreenOrder.indexOf(CUSTOM_CONTENT_SCREEN_ID); int scrollDelta = getScrollForPage(index + 1) - getScrollX(); float translationX = Math.max(scrollDelta, 0); @@ -4127,20 +4127,39 @@ public class Workspace extends SmoothPagedView } } - void moveToDefaultScreen(boolean animate) { + private void moveToScreen(int page, boolean animate) { if (!isSmall()) { if (animate) { - snapToPage(mDefaultPage); + snapToPage(page); } else { - setCurrentPage(mDefaultPage); + setCurrentPage(page); } } - View child = getChildAt(mDefaultPage); + View child = getChildAt(page); if (child != null) { child.requestFocus(); } } + void moveToDefaultScreen(boolean animate) { + moveToScreen(mDefaultPage, animate); + } + + void moveToCustomContentScreen(boolean animate) { + if (hasCustomContent()) { + int ccIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID); + if (animate) { + snapToPage(ccIndex); + } else { + setCurrentPage(ccIndex); + } + View child = getChildAt(ccIndex); + if (child != null) { + child.requestFocus(); + } + } + } + @Override protected int getPageIndicatorMarker(int pageIndex) { if (getScreenIdForPageIndex(pageIndex) == CUSTOM_CONTENT_SCREEN_ID) { |