Skip snapping to page when there are no pages

- This scrolls the recents view, which affects the empty recents icon
  position.

Bug: 79170402
Test: Clear all tasks, then quickscrub
Change-Id: I316805c0083d4ad65a8df0fafd88545859054405
This commit is contained in:
Winson Chung
2018-05-02 17:45:14 -07:00
parent b8e5bf3e42
commit 94262dedb7

View File

@@ -106,7 +106,7 @@ public class QuickScrubController implements OnAlarmListener {
};
int snapDuration = Math.abs(page - mRecentsView.getPageNearestToCenterOfScreen())
* QUICKSCRUB_END_SNAP_DURATION_PER_PAGE;
if (mRecentsView.snapToPage(page, snapDuration)) {
if (mRecentsView.getChildCount() > 0 && mRecentsView.snapToPage(page, snapDuration)) {
// Settle on the page then launch it
mRecentsView.setNextPageSwitchRunnable(launchTaskRunnable);
} else {