Fixing state transition bugs
- explicitly keeping track of state in Workspace - cancelling animations before starting new ones - adding additional state variable for workspace for in-progress transitions - updating Scroller object if we jump to a certain location Change-Id: I5ddf51bae543ec89b2a44ab651d7269eb4859a6d
This commit is contained in:
@@ -242,7 +242,9 @@ public abstract class PagedView extends ViewGroup {
|
||||
if (getChildCount() == 0) return;
|
||||
|
||||
mCurrentPage = Math.max(0, Math.min(currentPage, getPageCount() - 1));
|
||||
scrollTo(getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage), 0);
|
||||
int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
|
||||
scrollTo(newX, 0);
|
||||
mScroller.setFinalX(newX);
|
||||
|
||||
invalidate();
|
||||
notifyPageSwitchListener();
|
||||
|
||||
Reference in New Issue
Block a user