private int getClientHeight() { return getMeasuredHeight() - getPaddingTop() - getPaddingBottom(); }
int paddingTop = getPaddingTop(); int paddingRight = getPaddingRight(); int paddingBottom = getPaddingBottom();
int childHeightSize = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
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); } } }
final int scrollY = getScrollY(); int paddingTop = getPaddingTop(); int paddingBottom = getPaddingBottom(); final int height = getHeight(); final int childCount = getChildCount();
if (!isVertical && !mLeftEdge.isFinished()) { final int restoreCount = canvas.save(); final int height = getHeight() - getPaddingTop() - getPaddingBottom(); final int width = getWidth(); canvas.rotate(270); final int restoreCount = canvas.save(); final int width = getWidth(); final int height = getHeight() - getPaddingTop() - getPaddingBottom();
ii = itemIndex < mItems.size() ? mItems.get(itemIndex) : null; final float bottomHeightNeeded = clientHeight <= 0 ? 0 : (float) getPaddingBottom() / (float) clientHeight + 2.f;