List of usage examples for android.view ViewGroup setScrollY
public void setScrollY(int value)
From source file:org.chromium.chrome.browser.widget.animation.FocusAnimator.java
/** Scroll the layout so that the focused child is on screen. */ private void requestChildFocus() { ViewGroup parent = (ViewGroup) mLayout.getParent(); if (mLayout.getParent() == null) return;/*from w ww .j a v a 2 s . com*/ // Scroll the parent to make the focused child visible. if (mFocusedChild != null) parent.requestChildFocus(mLayout, mFocusedChild); // {@link View#requestChildFocus} fails to account for children changing their height, so // the scroll value may be past the actual maximum. int viewportHeight = parent.getBottom() - parent.getTop(); int scrollMax = Math.max(0, mLayout.getMeasuredHeight() - viewportHeight); if (parent.getScrollY() > scrollMax) parent.setScrollY(scrollMax); }