Merge "Fixing issue where the PagedView scroll is out of sync with the current page. (Bug 11050528)" into jb-ub-now-indigo-rose
This commit is contained in:
@@ -442,6 +442,13 @@ public class Workspace extends SmoothPagedView
|
|||||||
setLayoutTransition(mLayoutTransition);
|
setLayoutTransition(mLayoutTransition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enableLayoutTransitions() {
|
||||||
|
setLayoutTransition(mLayoutTransition);
|
||||||
|
}
|
||||||
|
void disableLayoutTransitions() {
|
||||||
|
setLayoutTransition(null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getScrollMode() {
|
protected int getScrollMode() {
|
||||||
return SmoothPagedView.X_LARGE_MODE;
|
return SmoothPagedView.X_LARGE_MODE;
|
||||||
@@ -489,10 +496,24 @@ public class Workspace extends SmoothPagedView
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeAllWorkspaceScreens() {
|
public void removeAllWorkspaceScreens() {
|
||||||
|
// Disable all layout transitions before removing all pages to ensure that we don't get the
|
||||||
|
// transition animations competing with us changing the scroll when we add pages or the
|
||||||
|
// custom content screen
|
||||||
|
disableLayoutTransitions();
|
||||||
|
|
||||||
|
// Since we increment the current page when we call addCustomContentPage via bindScreens
|
||||||
|
// (and other places), we need to adjust the current page back when we clear the pages
|
||||||
|
if (hasCustomContent()) {
|
||||||
|
removeCustomContentPage();
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the pages and clear the screen models
|
// Remove the pages and clear the screen models
|
||||||
removeAllViews();
|
removeAllViews();
|
||||||
mScreenOrder.clear();
|
mScreenOrder.clear();
|
||||||
mWorkspaceScreens.clear();
|
mWorkspaceScreens.clear();
|
||||||
|
|
||||||
|
// Re-enable the layout transitions
|
||||||
|
enableLayoutTransitions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long insertNewWorkspaceScreenBeforeEmptyScreen(long screenId) {
|
public long insertNewWorkspaceScreenBeforeEmptyScreen(long screenId) {
|
||||||
@@ -1822,7 +1843,7 @@ public class Workspace extends SmoothPagedView
|
|||||||
super.onStartReordering();
|
super.onStartReordering();
|
||||||
showOutlines();
|
showOutlines();
|
||||||
// Reordering handles its own animations, disable the automatic ones.
|
// Reordering handles its own animations, disable the automatic ones.
|
||||||
setLayoutTransition(null);
|
disableLayoutTransitions();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onEndReordering() {
|
protected void onEndReordering() {
|
||||||
@@ -1839,7 +1860,7 @@ public class Workspace extends SmoothPagedView
|
|||||||
mLauncher.getModel().updateWorkspaceScreenOrder(mLauncher, mScreenOrder);
|
mLauncher.getModel().updateWorkspaceScreenOrder(mLauncher, mScreenOrder);
|
||||||
|
|
||||||
// Re-enable auto layout transitions for page deletion.
|
// Re-enable auto layout transitions for page deletion.
|
||||||
setLayoutTransition(mLayoutTransition);
|
enableLayoutTransitions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInOverviewMode() {
|
public boolean isInOverviewMode() {
|
||||||
|
|||||||
Reference in New Issue
Block a user