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

Commit f9d7eedc authored by Alan Viverette's avatar Alan Viverette
Browse files

Expose View.OnScrollChangeListener interface

Allows clients to observe changes to scrollX / scrollY.

Bug: 19098033
Change-Id: I070e61a9532fe1f6cb5437eab94f7fffc1b17e97
parent 767cddd3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -33986,6 +33986,7 @@ package android.view {
    method public void setOnHoverListener(android.view.View.OnHoverListener);
    method public void setOnKeyListener(android.view.View.OnKeyListener);
    method public void setOnLongClickListener(android.view.View.OnLongClickListener);
    method public void setOnScrollChangeListener(android.view.View.OnScrollChangeListener);
    method public void setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener);
    method public void setOnTouchListener(android.view.View.OnTouchListener);
    method public void setOutlineProvider(android.view.ViewOutlineProvider);
@@ -34253,6 +34254,10 @@ package android.view {
    method public abstract boolean onLongClick(android.view.View);
  }
  public static abstract interface View.OnScrollChangeListener {
    method public abstract void onScrollChange(android.view.View, int, int, int, int);
  }
  public static abstract interface View.OnSystemUiVisibilityChangeListener {
    method public abstract void onSystemUiVisibilityChange(int);
  }
+19 −6
Original line number Diff line number Diff line
@@ -4567,11 +4567,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    /**
     * Register a callback to be invoked when the scroll position of this view
     * changed.
     * Register a callback to be invoked when the scroll X or Y positions of
     * this view change.
     * <p>
     * <b>Note:</b> Some views handle scrolling independently from View and may
     * have their own separate listeners for scroll-type events. For example,
     * {@link android.widget.ListView ListView} allows clients to register an
     * {@link android.widget.ListView#setOnScrollListener(android.widget.AbsListView.OnScrollListener) AbsListView.OnScrollListener}
     * to listen for changes in list scroll position.
     *
     * @param l The callback that will run.
     * @hide Only used internally.
     * @param l The listener to notify when the scroll X or Y position changes.
     * @see android.view.View#getScrollX()
     * @see android.view.View#getScrollY()
     */
    public void setOnScrollChangeListener(OnScrollChangeListener l) {
        getListenerInfo().mOnScrollChangeListener = l;
@@ -9957,9 +9964,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    /**
     * Interface definition for a callback to be invoked when the scroll
     * position of a view changes.
     * X or Y positions of a view change.
     * <p>
     * <b>Note:</b> Some views handle scrolling independently from View and may
     * have their own separate listeners for scroll-type events. For example,
     * {@link android.widget.ListView ListView} allows clients to register an
     * {@link android.widget.ListView#setOnScrollListener(android.widget.AbsListView.OnScrollListener) AbsListView.OnScrollListener}
     * to listen for changes in list scroll position.
     *
     * @hide Only used internally.
     * @see #setOnScrollChangeListener(View.OnScrollChangeListener)
     */
    public interface OnScrollChangeListener {
        /**