private ItemInfo infoForCurrentScrollPositionVertical() { final int height = getClientHeight();
final int height = getClientHeight(); final int heightWithMargin = height + mPageMargin; final float marginOffset = (float) mPageMargin / height;
private void calculatePageOffsetsVertical(ItemInfo curItem, int curIndex, ItemInfo oldCurInfo) { final int N = getAdapterCount(); final int height = getClientHeight(); final float marginOffset = height > 0 ? (float) mPageMargin / height : 0;
final int height = getClientHeight();
private void scrollToItemVertical(int item, boolean smoothScroll, int velocity, boolean dispatchSelected) { final ItemInfo curInfo = infoForPosition(item); int destY = 0; if (curInfo != null) { final int height = getClientHeight(); destY = (int) (height * Math.max(mFirstOffset, Math.min(curInfo.offset, mLastOffset))); mDestY = destY; } if (smoothScroll) { smoothScrollToVertical(0, destY, velocity); if (dispatchSelected) { dispatchOnPageSelected(item); } } else { if (dispatchSelected) { dispatchOnPageSelected(item); } completeScrollVertical(false); scrollTo(0, destY); pageScrolledVertical(destY); } }
setScrollState(SCROLL_STATE_SETTLING); final int height = getClientHeight(); final int halfHeight = height / 2; final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dy) / height);
final LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.isDecor) continue; final float transformPos = (float) (child.getTop() - scrollY) / getClientHeight(); mPageTransformer.transformPage(child, transformPos);
int itemIndex = curIndex - 1; ItemInfo ii = itemIndex >= 0 ? mItems.get(itemIndex) : null; final int clientHeight = getClientHeight();
mPopulatePending = true; final int width = getClientWidth(); final int height = getClientHeight();
private void recomputeScrollPositionVertical(int height, int oldHeight, int margin, int oldMargin) { if (oldHeight > 0 && !mItems.isEmpty()) { if (!mScroller.isFinished()) { mScroller.setFinalY(getCurrentItem() * getClientHeight()); } else { final int heightWithMargin = height - getPaddingTop() - getPaddingBottom() + margin; final int oldHeightWithMargin = oldHeight - getPaddingTop() - getPaddingBottom() + oldMargin; final int ypos = getScrollY(); final float pageOffset = (float) ypos / oldHeightWithMargin; final int newOffsetPixels = (int) (pageOffset * heightWithMargin); scrollTo(getScrollX(), newOffsetPixels); } } else { final ItemInfo ii = infoForPosition(mCurItem); final float scrollOffset = ii != null ? Math.min(ii.offset, mLastOffset) : 0; final int scrollPos = (int) (scrollOffset * (height - getPaddingTop() - getPaddingBottom())); if (scrollPos != getScrollY()) { completeScrollVertical(false); scrollTo(getScrollX(), scrollPos); } } }