Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdbf484b authored by Romain Guy's avatar Romain Guy
Browse files

Add documentation for fillViewport.

Change-Id: I34f5418ca33933dc5cf65f4e417d918bce83ab96
parent fed762b9
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ import java.util.List;
 * within a larger container.
 *
 * <p>HorizontalScrollView only supports horizontal scrolling.
 * 
 * @attr ref android.R.styleable#HorizontalScrollView_fillViewport 
 */
public class HorizontalScrollView extends FrameLayout {
    private static final int ANIMATED_SCROLL_GAP = ScrollView.ANIMATED_SCROLL_GAP;
@@ -248,20 +250,25 @@ public class HorizontalScrollView extends FrameLayout {
    }

    /**
     * Indicates whether this ScrollView's content is stretched to fill the viewport.
     * Indicates whether this HorizontalScrollView's content is stretched to
     * fill the viewport.
     *
     * @return True if the content fills the viewport, false otherwise.
     *
     * @attr ref android.R.styleable#HorizontalScrollView_fillViewport
     */
    public boolean isFillViewport() {
        return mFillViewport;
    }

    /**
     * Indicates this ScrollView whether it should stretch its content width to fill
     * the viewport or not.
     * Indicates this HorizontalScrollView whether it should stretch its content width
     * to fill the viewport or not.
     *
     * @param fillViewport True to stretch the content's width to the viewport's
     *        boundaries, false otherwise.
     * 
     * @attr ref android.R.styleable#HorizontalScrollView_fillViewport
     */
    public void setFillViewport(boolean fillViewport) {
        if (fillViewport != mFillViewport) {
+6 −10
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ import java.util.List;
 * within a larger container.
 * 
 * <p>ScrollView only supports vertical scrolling.
 *
 * @attr ref android.R.styleable#ScrollView_fillViewport
 */
public class ScrollView extends FrameLayout {
    static final int ANIMATED_SCROLL_GAP = 250;
@@ -247,6 +249,8 @@ public class ScrollView extends FrameLayout {
     * Indicates whether this ScrollView's content is stretched to fill the viewport.
     *
     * @return True if the content fills the viewport, false otherwise.
     * 
     * @attr ref android.R.styleable#ScrollView_fillViewport
     */
    public boolean isFillViewport() {
        return mFillViewport;
@@ -258,6 +262,8 @@ public class ScrollView extends FrameLayout {
     *
     * @param fillViewport True to stretch the content's height to the viewport's
     *        boundaries, false otherwise.
     * 
     * @attr ref android.R.styleable#ScrollView_fillViewport
     */
    public void setFillViewport(boolean fillViewport) {
        if (fillViewport != mFillViewport) {
@@ -566,16 +572,6 @@ public class ScrollView extends FrameLayout {
        }
    }
    
    private int getScrollRange() {
        int scrollRange = 0;
        if (getChildCount() > 0) {
            View child = getChildAt(0);
            scrollRange = Math.max(0,
                    child.getHeight() - getHeight() - mPaddingBottom - mPaddingTop);
        }
        return scrollRange;
    }

    /**
     * <p>
     * Finds the next focusable component that fits in this View's bounds