Loading res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <dimen name="two_panel_home_side_padding">18dp</dimen> <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> <dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen> Loading src/com/android/launcher3/DeviceProfile.java +10 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,12 @@ public class DeviceProfile { int cellLayoutPadding = isScalableGrid ? 0 : res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); if (isLandscape) { if (FeatureFlags.ENABLE_TWO_PANEL_HOME.get() && isTablet) { cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize(R.dimen.two_panel_home_side_padding); cellLayoutBottomPaddingPx = 0; } else if (isLandscape) { cellLayoutPaddingLeftRightPx = 0; cellLayoutBottomPaddingPx = cellLayoutPadding; } else { Loading Loading @@ -660,6 +665,10 @@ public class DeviceProfile { - (2 * inv.numRows * cellHeightPx) - hotseatVerticalPadding); padding.set(availablePaddingX / 2, edgeMarginPx + availablePaddingY / 2, availablePaddingX / 2, paddingBottom + availablePaddingY / 2); if (FeatureFlags.ENABLE_TWO_PANEL_HOME.get()) { padding.set(0, padding.top, 0, padding.bottom); } } else { // Pad the top and bottom of the workspace with search/hotseat bar sizes padding.set(desiredWorkspaceLeftRightMarginPx, Loading src/com/android/launcher3/InvariantDeviceProfile.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.launcher3; import static com.android.launcher3.Utilities.getDevicePrefs; import static com.android.launcher3.Utilities.getPointString; import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS; import static com.android.launcher3.config.FeatureFlags.ENABLE_TWO_PANEL_HOME; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter; Loading Loading @@ -235,6 +236,9 @@ public class InvariantDeviceProfile { } public static String getCurrentGridName(Context context) { if (ENABLE_TWO_PANEL_HOME.get()) { return ENABLE_TWO_PANEL_HOME.key; } if (ENABLE_FOUR_COLUMNS.get()) { return ENABLE_FOUR_COLUMNS.key; } Loading src/com/android/launcher3/PagedView.java +63 −13 Original line number Diff line number Diff line Loading @@ -282,7 +282,32 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou private int validateNewPage(int newPage) { newPage = ensureWithinScrollBounds(newPage); // Ensure that it is clamped by the actual set of children in all cases return Utilities.boundToRange(newPage, 0, getPageCount() - 1); newPage = Utilities.boundToRange(newPage, 0, getPageCount() - 1); if (getPanelCount() > 1) { // Always return left panel as new page newPage = getLeftmostVisiblePageForIndex(newPage); } return newPage; } private int getLeftmostVisiblePageForIndex(int pageIndex) { int panelCount = getPanelCount(); return (pageIndex / panelCount) * panelCount; } /** * Returns the number of pages that are shown at the same time. */ protected int getPanelCount() { return 1; } /** * Returns true if the view is on one of the current pages, false otherwise. */ public boolean isVisible(View child) { return getLeftmostVisiblePageForIndex(indexOfChild(child)) == mCurrentPage; } /** Loading Loading @@ -548,6 +573,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou super.forceLayout(); } private int getPageWidthSize(int widthSize) { return (widthSize - mInsets.left - mInsets.right) / getPanelCount(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getChildCount() == 0) { Loading Loading @@ -578,7 +607,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou if (DEBUG) Log.d(TAG, "PagedView.onMeasure(): " + widthSize + ", " + heightSize); int myWidthSpec = MeasureSpec.makeMeasureSpec( widthSize - mInsets.left - mInsets.right, MeasureSpec.EXACTLY); getPageWidthSize(widthSize), MeasureSpec.EXACTLY); int myHeightSpec = MeasureSpec.makeMeasureSpec( heightSize - mInsets.top - mInsets.bottom, MeasureSpec.EXACTLY); Loading Loading @@ -672,9 +701,11 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // In case the pages are of different width, align the page to left or right edge // based on the orientation. // In case we have multiple panels on the screen, scrollOffsetEnd is the scroll // needed for the whole visible area, so we have to divide it by panelCount. final int pageScroll = mIsRtl ? (childStart - scrollOffsetStart) : Math.max(0, childPrimaryEnd - scrollOffsetEnd); : Math.max(0, childPrimaryEnd - scrollOffsetEnd / getPanelCount()); if (outPageScrolls[i] != pageScroll) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; Loading @@ -682,6 +713,19 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou childStart += primaryDimension + mPageSpacing + getChildGap(); } } int panelCount = getPanelCount(); if (panelCount > 1) { for (int i = 0; i < childCount; i++) { // In case we have multiple panels, always use left panel's page scroll for all // panels on the screen. int adjustedScroll = outPageScrolls[getLeftmostVisiblePageForIndex(i)]; if (outPageScrolls[i] != adjustedScroll) { outPageScrolls[i] = adjustedScroll; pageScrollChanged = true; } } } return pageScrollChanged; } Loading Loading @@ -794,14 +838,16 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou } if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); getChildAt(getCurrentPage() - 1).requestFocus(direction); int nextPage = validateNewPage(getCurrentPage() - 1); snapToPage(nextPage); getChildAt(nextPage).requestFocus(direction); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); getChildAt(getCurrentPage() + 1).requestFocus(direction); int nextPage = validateNewPage(getCurrentPage() + 1); snapToPage(nextPage); getChildAt(nextPage).requestFocus(direction); return true; } } Loading @@ -820,11 +866,13 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou } if (direction == View.FOCUS_LEFT) { if (mCurrentPage > 0) { getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode); int nextPage = validateNewPage(mCurrentPage - 1); getPageAt(nextPage).addFocusables(views, direction, focusableMode); } } else if (direction == View.FOCUS_RIGHT) { if (mCurrentPage < getPageCount() - 1) { getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode); int nextPage = validateNewPage(mCurrentPage + 1); getPageAt(nextPage).addFocusables(views, direction, focusableMode); } } } Loading Loading @@ -1255,12 +1303,14 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou if (((isSignificantMove && !isDeltaLeft && !isFling) || (isFling && !isVelocityLeft)) && mCurrentPage > 0) { finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - 1; finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - getPanelCount(); snapToPageWithVelocity(finalPage, velocity); } else if (((isSignificantMove && isDeltaLeft && !isFling) || (isFling && isVelocityLeft)) && mCurrentPage < getChildCount() - 1) { finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + 1; finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + getPanelCount(); snapToPageWithVelocity(finalPage, velocity); } else { snapToDestination(); Loading src/com/android/launcher3/Workspace.java +44 −7 Original line number Diff line number Diff line Loading @@ -313,7 +313,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // Increase our bottom insets so we don't overlap with the taskbar. mInsets.bottom += grid.nonOverlappingTaskbarInset; if (mWorkspaceFadeInAdjacentScreens) { if (isTwoPanelEnabled()) { setPageSpacing(0); // we have two pages and we don't want any spacing } else if (mWorkspaceFadeInAdjacentScreens) { // In landscape mode the page spacing is set to the default. setPageSpacing(grid.edgeMarginPx); } else { Loading @@ -325,12 +327,30 @@ public class Workspace extends PagedView<WorkspacePageIndicator> setPageSpacing(Math.max(maxInsets, maxPadding)); } int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx; int paddingBottom = grid.cellLayoutBottomPaddingPx; int twoPanelLandscapeSidePadding = paddingLeftRight * 2; int twoPanelPortraitSidePadding = paddingLeftRight / 2; int panelCount = getPanelCount(); for (int i = mWorkspaceScreens.size() - 1; i >= 0; i--) { mWorkspaceScreens.valueAt(i) .setPadding(paddingLeftRight, 0, paddingLeftRight, paddingBottom); int paddingLeft = paddingLeftRight; int paddingRight = paddingLeftRight; if (panelCount > 1) { if (i % panelCount == 0) { // left side panel paddingLeft = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingRight = 0; } else if (i % panelCount == panelCount - 1) { // right side panel paddingLeft = 0; paddingRight = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; } else { // middle panel paddingLeft = 0; paddingRight = 0; } } mWorkspaceScreens.valueAt(i).setPadding(paddingLeft, 0, paddingRight, paddingBottom); } } Loading Loading @@ -437,6 +457,15 @@ public class Workspace extends PagedView<WorkspacePageIndicator> .log(LauncherEvent.LAUNCHER_ITEM_DRAG_STARTED); } private boolean isTwoPanelEnabled() { return mLauncher.mDeviceProfile.isTablet && FeatureFlags.ENABLE_TWO_PANEL_HOME.get(); } @Override protected int getPanelCount() { return isTwoPanelEnabled() ? 2 : super.getPanelCount(); } public void deferRemoveExtraEmptyScreen() { mDeferRemoveExtraEmptyScreen = true; } Loading Loading @@ -824,7 +853,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> private boolean shouldConsumeTouch(View v) { return !workspaceIconsCanBeDragged() || (!workspaceInModalState() && indexOfChild(v) != mCurrentPage); || (!workspaceInModalState() && !isVisible(v)); } public boolean isSwitchingState() { Loading Loading @@ -2260,19 +2289,27 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int nextPage = getNextPage(); if (layout == null && !isPageInTransition()) { // Check if the item is dragged over left page // Check if the item is dragged over currentPage - 1 page mTempTouchCoordinates[0] = Math.min(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? 1 : -1), mTempTouchCoordinates); } if (layout == null && !isPageInTransition()) { // Check if the item is dragged over right page // Check if the item is dragged over currentPage + 1 page mTempTouchCoordinates[0] = Math.max(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? -1 : 1), mTempTouchCoordinates); } // If two panel is enabled, users can also drag items to currentPage + 2 if (isTwoPanelEnabled() && layout == null && !isPageInTransition()) { // Check if the item is dragged over currentPage + 2 page mTempTouchCoordinates[0] = Math.max(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? -2 : 2), mTempTouchCoordinates); } // Always pick the current page. if (layout == null && nextPage >= 0 && nextPage < getPageCount()) { layout = (CellLayout) getChildAt(nextPage); Loading Loading
res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <dimen name="two_panel_home_side_padding">18dp</dimen> <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> <dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen> Loading
src/com/android/launcher3/DeviceProfile.java +10 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,12 @@ public class DeviceProfile { int cellLayoutPadding = isScalableGrid ? 0 : res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); if (isLandscape) { if (FeatureFlags.ENABLE_TWO_PANEL_HOME.get() && isTablet) { cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize(R.dimen.two_panel_home_side_padding); cellLayoutBottomPaddingPx = 0; } else if (isLandscape) { cellLayoutPaddingLeftRightPx = 0; cellLayoutBottomPaddingPx = cellLayoutPadding; } else { Loading Loading @@ -660,6 +665,10 @@ public class DeviceProfile { - (2 * inv.numRows * cellHeightPx) - hotseatVerticalPadding); padding.set(availablePaddingX / 2, edgeMarginPx + availablePaddingY / 2, availablePaddingX / 2, paddingBottom + availablePaddingY / 2); if (FeatureFlags.ENABLE_TWO_PANEL_HOME.get()) { padding.set(0, padding.top, 0, padding.bottom); } } else { // Pad the top and bottom of the workspace with search/hotseat bar sizes padding.set(desiredWorkspaceLeftRightMarginPx, Loading
src/com/android/launcher3/InvariantDeviceProfile.java +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.launcher3; import static com.android.launcher3.Utilities.getDevicePrefs; import static com.android.launcher3.Utilities.getPointString; import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS; import static com.android.launcher3.config.FeatureFlags.ENABLE_TWO_PANEL_HOME; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter; Loading Loading @@ -235,6 +236,9 @@ public class InvariantDeviceProfile { } public static String getCurrentGridName(Context context) { if (ENABLE_TWO_PANEL_HOME.get()) { return ENABLE_TWO_PANEL_HOME.key; } if (ENABLE_FOUR_COLUMNS.get()) { return ENABLE_FOUR_COLUMNS.key; } Loading
src/com/android/launcher3/PagedView.java +63 −13 Original line number Diff line number Diff line Loading @@ -282,7 +282,32 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou private int validateNewPage(int newPage) { newPage = ensureWithinScrollBounds(newPage); // Ensure that it is clamped by the actual set of children in all cases return Utilities.boundToRange(newPage, 0, getPageCount() - 1); newPage = Utilities.boundToRange(newPage, 0, getPageCount() - 1); if (getPanelCount() > 1) { // Always return left panel as new page newPage = getLeftmostVisiblePageForIndex(newPage); } return newPage; } private int getLeftmostVisiblePageForIndex(int pageIndex) { int panelCount = getPanelCount(); return (pageIndex / panelCount) * panelCount; } /** * Returns the number of pages that are shown at the same time. */ protected int getPanelCount() { return 1; } /** * Returns true if the view is on one of the current pages, false otherwise. */ public boolean isVisible(View child) { return getLeftmostVisiblePageForIndex(indexOfChild(child)) == mCurrentPage; } /** Loading Loading @@ -548,6 +573,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou super.forceLayout(); } private int getPageWidthSize(int widthSize) { return (widthSize - mInsets.left - mInsets.right) / getPanelCount(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getChildCount() == 0) { Loading Loading @@ -578,7 +607,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou if (DEBUG) Log.d(TAG, "PagedView.onMeasure(): " + widthSize + ", " + heightSize); int myWidthSpec = MeasureSpec.makeMeasureSpec( widthSize - mInsets.left - mInsets.right, MeasureSpec.EXACTLY); getPageWidthSize(widthSize), MeasureSpec.EXACTLY); int myHeightSpec = MeasureSpec.makeMeasureSpec( heightSize - mInsets.top - mInsets.bottom, MeasureSpec.EXACTLY); Loading Loading @@ -672,9 +701,11 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // In case the pages are of different width, align the page to left or right edge // based on the orientation. // In case we have multiple panels on the screen, scrollOffsetEnd is the scroll // needed for the whole visible area, so we have to divide it by panelCount. final int pageScroll = mIsRtl ? (childStart - scrollOffsetStart) : Math.max(0, childPrimaryEnd - scrollOffsetEnd); : Math.max(0, childPrimaryEnd - scrollOffsetEnd / getPanelCount()); if (outPageScrolls[i] != pageScroll) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; Loading @@ -682,6 +713,19 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou childStart += primaryDimension + mPageSpacing + getChildGap(); } } int panelCount = getPanelCount(); if (panelCount > 1) { for (int i = 0; i < childCount; i++) { // In case we have multiple panels, always use left panel's page scroll for all // panels on the screen. int adjustedScroll = outPageScrolls[getLeftmostVisiblePageForIndex(i)]; if (outPageScrolls[i] != adjustedScroll) { outPageScrolls[i] = adjustedScroll; pageScrollChanged = true; } } } return pageScrollChanged; } Loading Loading @@ -794,14 +838,16 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou } if (direction == View.FOCUS_LEFT) { if (getCurrentPage() > 0) { snapToPage(getCurrentPage() - 1); getChildAt(getCurrentPage() - 1).requestFocus(direction); int nextPage = validateNewPage(getCurrentPage() - 1); snapToPage(nextPage); getChildAt(nextPage).requestFocus(direction); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentPage() < getPageCount() - 1) { snapToPage(getCurrentPage() + 1); getChildAt(getCurrentPage() + 1).requestFocus(direction); int nextPage = validateNewPage(getCurrentPage() + 1); snapToPage(nextPage); getChildAt(nextPage).requestFocus(direction); return true; } } Loading @@ -820,11 +866,13 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou } if (direction == View.FOCUS_LEFT) { if (mCurrentPage > 0) { getPageAt(mCurrentPage - 1).addFocusables(views, direction, focusableMode); int nextPage = validateNewPage(mCurrentPage - 1); getPageAt(nextPage).addFocusables(views, direction, focusableMode); } } else if (direction == View.FOCUS_RIGHT) { if (mCurrentPage < getPageCount() - 1) { getPageAt(mCurrentPage + 1).addFocusables(views, direction, focusableMode); int nextPage = validateNewPage(mCurrentPage + 1); getPageAt(nextPage).addFocusables(views, direction, focusableMode); } } } Loading Loading @@ -1255,12 +1303,14 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou if (((isSignificantMove && !isDeltaLeft && !isFling) || (isFling && !isVelocityLeft)) && mCurrentPage > 0) { finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - 1; finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage - getPanelCount(); snapToPageWithVelocity(finalPage, velocity); } else if (((isSignificantMove && isDeltaLeft && !isFling) || (isFling && isVelocityLeft)) && mCurrentPage < getChildCount() - 1) { finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + 1; finalPage = returnToOriginalPage ? mCurrentPage : mCurrentPage + getPanelCount(); snapToPageWithVelocity(finalPage, velocity); } else { snapToDestination(); Loading
src/com/android/launcher3/Workspace.java +44 −7 Original line number Diff line number Diff line Loading @@ -313,7 +313,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // Increase our bottom insets so we don't overlap with the taskbar. mInsets.bottom += grid.nonOverlappingTaskbarInset; if (mWorkspaceFadeInAdjacentScreens) { if (isTwoPanelEnabled()) { setPageSpacing(0); // we have two pages and we don't want any spacing } else if (mWorkspaceFadeInAdjacentScreens) { // In landscape mode the page spacing is set to the default. setPageSpacing(grid.edgeMarginPx); } else { Loading @@ -325,12 +327,30 @@ public class Workspace extends PagedView<WorkspacePageIndicator> setPageSpacing(Math.max(maxInsets, maxPadding)); } int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx; int paddingBottom = grid.cellLayoutBottomPaddingPx; int twoPanelLandscapeSidePadding = paddingLeftRight * 2; int twoPanelPortraitSidePadding = paddingLeftRight / 2; int panelCount = getPanelCount(); for (int i = mWorkspaceScreens.size() - 1; i >= 0; i--) { mWorkspaceScreens.valueAt(i) .setPadding(paddingLeftRight, 0, paddingLeftRight, paddingBottom); int paddingLeft = paddingLeftRight; int paddingRight = paddingLeftRight; if (panelCount > 1) { if (i % panelCount == 0) { // left side panel paddingLeft = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingRight = 0; } else if (i % panelCount == panelCount - 1) { // right side panel paddingLeft = 0; paddingRight = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; } else { // middle panel paddingLeft = 0; paddingRight = 0; } } mWorkspaceScreens.valueAt(i).setPadding(paddingLeft, 0, paddingRight, paddingBottom); } } Loading Loading @@ -437,6 +457,15 @@ public class Workspace extends PagedView<WorkspacePageIndicator> .log(LauncherEvent.LAUNCHER_ITEM_DRAG_STARTED); } private boolean isTwoPanelEnabled() { return mLauncher.mDeviceProfile.isTablet && FeatureFlags.ENABLE_TWO_PANEL_HOME.get(); } @Override protected int getPanelCount() { return isTwoPanelEnabled() ? 2 : super.getPanelCount(); } public void deferRemoveExtraEmptyScreen() { mDeferRemoveExtraEmptyScreen = true; } Loading Loading @@ -824,7 +853,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> private boolean shouldConsumeTouch(View v) { return !workspaceIconsCanBeDragged() || (!workspaceInModalState() && indexOfChild(v) != mCurrentPage); || (!workspaceInModalState() && !isVisible(v)); } public boolean isSwitchingState() { Loading Loading @@ -2260,19 +2289,27 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int nextPage = getNextPage(); if (layout == null && !isPageInTransition()) { // Check if the item is dragged over left page // Check if the item is dragged over currentPage - 1 page mTempTouchCoordinates[0] = Math.min(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? 1 : -1), mTempTouchCoordinates); } if (layout == null && !isPageInTransition()) { // Check if the item is dragged over right page // Check if the item is dragged over currentPage + 1 page mTempTouchCoordinates[0] = Math.max(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? -1 : 1), mTempTouchCoordinates); } // If two panel is enabled, users can also drag items to currentPage + 2 if (isTwoPanelEnabled() && layout == null && !isPageInTransition()) { // Check if the item is dragged over currentPage + 2 page mTempTouchCoordinates[0] = Math.max(centerX, d.x); mTempTouchCoordinates[1] = d.y; layout = verifyInsidePage(nextPage + (mIsRtl ? -2 : 2), mTempTouchCoordinates); } // Always pick the current page. if (layout == null && nextPage >= 0 && nextPage < getPageCount()) { layout = (CellLayout) getChildAt(nextPage); Loading