diff options
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 63211bde1..75bf26986 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -537,6 +537,7 @@ public class Workspace extends SmoothPagedView CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, spanX, spanY); lp.canReorder = false; + lp.isFullscreen = true; customScreen.addViewToCellLayout(customContent, 0, 0, lp, true); @@ -769,6 +770,13 @@ public class Workspace extends SmoothPagedView protected void onWindowVisibilityChanged (int visibility) { mLauncher.onWindowVisibilityChanged(visibility); + if (mCustomContentShowing && mCustomContentCallbacks != null) { + if (visibility == View.VISIBLE) { + mCustomContentCallbacks.onShow(); + } else if (visibility == View.GONE) { + mCustomContentCallbacks.onHide(); + } + } } @Override @@ -929,25 +937,25 @@ public class Workspace extends SmoothPagedView stripEmptyScreens(); mStripScreensOnPageStopMoving = false; } - } - - @Override - protected void notifyPageSwitchListener() { - super.notifyPageSwitchListener(); - Launcher.setScreen(mCurrentPage); - if (hasCustomContent() && mCurrentPage == 0) { + if (hasCustomContent() && getNextPage() == 0 && !mCustomContentShowing) { mCustomContentShowing = true; if (mCustomContentCallbacks != null) { mCustomContentCallbacks.onShow(); } - } else if (hasCustomContent() && mCustomContentShowing) { + } else if (hasCustomContent() && getNextPage() != 0 && mCustomContentShowing) { mCustomContentShowing = false; if (mCustomContentCallbacks != null) { mCustomContentCallbacks.onHide(); mLauncher.resetQSBScroll(); } } + } + + @Override + protected void notifyPageSwitchListener() { + super.notifyPageSwitchListener(); + Launcher.setScreen(mCurrentPage); }; // As a ratio of screen height, the total distance we want the parallax effect to span @@ -1302,11 +1310,9 @@ public class Workspace extends SmoothPagedView private void updateStateForCustomContent(int screenCenter) { if (hasCustomContent()) { - CellLayout customContent = getScreenWithId(CUSTOM_CONTENT_SCREEN_ID); int index = mScreenOrder.indexOf(CUSTOM_CONTENT_SCREEN_ID); int scrollDelta = getScrollForPage(index + 1) - getScrollX(); - float translationX = Math.max(scrollDelta, 0); float progress = (1.0f * scrollDelta) / (getScrollForPage(index + 1) - getScrollForPage(index)); @@ -1317,6 +1323,7 @@ public class Workspace extends SmoothPagedView if (mLauncher.getHotseat() != null) { mLauncher.getHotseat().setTranslationY(transY); + mLauncher.getHotseat().setAlpha(1 - progress); } if (getPageIndicator() != null) { getPageIndicator().setAlpha(1 - progress); @@ -4023,6 +4030,14 @@ public class Workspace extends SmoothPagedView } @Override + protected int getPageIndicatorMarker(int pageIndex) { + if (getScreenIdForPageIndex(pageIndex) == CUSTOM_CONTENT_SCREEN_ID) { + return R.layout.now_page_indicator_marker; + } + return super.getPageIndicatorMarker(pageIndex); + } + + @Override public void syncPages() { } |