Do not run page snap animation if already on the default page

Bug: 63454716
Change-Id: Ibf3eea7f1b967c6e43042c87fd4545c03edf38e8
This commit is contained in:
Sunny Goyal 2017-07-10 12:52:00 -07:00
parent 848cad56ce
commit 5760ca1769
1 changed files with 3 additions and 6 deletions

View File

@ -3979,8 +3979,9 @@ public class Workspace extends PagedView
}
}
private void moveToScreen(int page, boolean animate) {
if (!workspaceInModalState()) {
void moveToDefaultScreen(boolean animate) {
int page = getDefaultPage();
if (!workspaceInModalState() && getCurrentPage() != page) {
if (animate) {
snapToPage(page);
} else {
@ -3993,10 +3994,6 @@ public class Workspace extends PagedView
}
}
void moveToDefaultScreen(boolean animate) {
moveToScreen(getDefaultPage(), animate);
}
void moveToCustomContentScreen(boolean animate) {
if (hasCustomContent()) {
int ccIndex = getPageIndexForScreenId(CUSTOM_CONTENT_SCREEN_ID);