* commit '7fc1887ede6695b4293891e4b2c29b3be3cc15f8': Fixing NPE in updateCurrentPageScroll (Bug 7465970)
This commit is contained in:
@@ -297,9 +297,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
* the previous tab page.
|
||||
*/
|
||||
protected void updateCurrentPageScroll() {
|
||||
int offset = getChildOffset(mCurrentPage);
|
||||
int relOffset = getRelativeChildOffset(mCurrentPage);
|
||||
int newX = offset - relOffset;
|
||||
// If the current page is invalid, just reset the scroll position to zero
|
||||
int newX = 0;
|
||||
if (0 <= mCurrentPage && mCurrentPage < getPageCount()) {
|
||||
int offset = getChildOffset(mCurrentPage);
|
||||
int relOffset = getRelativeChildOffset(mCurrentPage);
|
||||
newX = offset - relOffset;
|
||||
}
|
||||
scrollTo(newX, 0);
|
||||
mScroller.setFinalX(newX);
|
||||
mScroller.forceFinished(true);
|
||||
|
||||
Reference in New Issue
Block a user