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

Commit 51c5a0c5 authored by Adam Powell's avatar Adam Powell
Browse files

Added accessors for view overscroll modes

parent bda5780d
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
@@ -175466,6 +175466,17 @@
 visibility="public"
>
</method>
<method name="getOverscrollMode"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getPaddingBottom"
 return="int"
 abstract="false"
@@ -177631,6 +177642,19 @@
<parameter name="l" type="android.view.View.OnTouchListener">
</parameter>
</method>
<method name="setOverscrollMode"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="overscrollMode" type="int">
</parameter>
</method>
<method name="setPadding"
 return="void"
 abstract="false"
@@ -178253,6 +178277,39 @@
 visibility="public"
>
</field>
<field name="OVERSCROLL_ALWAYS"
 type="int"
 transient="false"
 volatile="false"
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="OVERSCROLL_IF_CONTENT_SCROLLS"
 type="int"
 transient="false"
 volatile="false"
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="OVERSCROLL_NEVER"
 type="int"
 transient="false"
 volatile="false"
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET"
 type="int[]"
 transient="false"
+44 −3
Original line number Diff line number Diff line
@@ -1516,19 +1516,28 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
    /**
     * Always allow a user to overscroll this view, provided it is a
     * view that can scroll.
     * 
     * @see #getOverscrollMode()
     * @see #setOverscrollMode(int)
     */
    private static final int OVERSCROLL_ALWAYS = 0;
    public static final int OVERSCROLL_ALWAYS = 0;
    
    /**
     * Allow a user to overscroll this view only if the content is large
     * enough to meaningfully scroll, provided it is a view that can scroll.
     * 
     * @see #getOverscrollMode()
     * @see #setOverscrollMode(int)
     */
    private static final int OVERSCROLL_IF_CONTENT_SCROLLS = 1;
    public static final int OVERSCROLL_IF_CONTENT_SCROLLS = 1;
    
    /**
     * Never allow a user to overscroll this view.
     * 
     * @see #getOverscrollMode()
     * @see #setOverscrollMode(int)
     */
    private static final int OVERSCROLL_NEVER = 2;
    public static final int OVERSCROLL_NEVER = 2;
    
    /**
     * Controls the overscroll mode for this view.
@@ -8771,6 +8780,38 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
        // Intentionally empty.
    }
    
    /**
     * Returns the overscroll mode for this view. The result will be
     * one of {@link #OVERSCROLL_ALWAYS} (default), {@link #OVERSCROLL_IF_CONTENT_SCROLLS}
     * (allow overscrolling only if the view content is larger than the container),
     * or {@link #OVERSCROLL_NEVER}.
     * 
     * @return This view's overscroll mode.
     */
    public int getOverscrollMode() {
        return mOverscrollMode;
    }
    
    /**
     * Set the overscroll mode for this view. Valid overscroll modes are
     * {@link #OVERSCROLL_ALWAYS} (default), {@link #OVERSCROLL_IF_CONTENT_SCROLLS}
     * (allow overscrolling only if the view content is larger than the container),
     * or {@link #OVERSCROLL_NEVER}.
     * 
     * Setting the overscroll mode of a view will have an effect only if the
     * view is capable of scrolling.
     * 
     * @param overscrollMode The new overscroll mode for this view.
     */
    public void setOverscrollMode(int overscrollMode) {
        if (overscrollMode != OVERSCROLL_ALWAYS &&
                overscrollMode != OVERSCROLL_IF_CONTENT_SCROLLS &&
                overscrollMode != OVERSCROLL_NEVER) {
            throw new IllegalArgumentException("Invalid overscroll mode " + overscrollMode);
        }
        mOverscrollMode = overscrollMode;
    }

    /**
     * A MeasureSpec encapsulates the layout requirements passed from parent to child.
     * Each MeasureSpec represents a requirement for either the width or the height.