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

Commit 4d6fe5ff authored by Mike Reed's avatar Mike Reed
Browse files

allow subclassing for drawing vertical scrollbar, so that clients (e.g....

allow subclassing for drawing vertical scrollbar, so that clients (e.g. webview) can resize/position
parent 558340f2
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -5409,6 +5409,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
        scrollBar.draw(canvas);
    }

    /**
     *  @hide
     */
    protected void onDrawVScrollBar(Canvas canvas, ScrollBarDrawable scrollBar,
                                    int l, int t, int r, int b) {
        scrollBar.setBounds(l, t, r, b);
        scrollBar.setParameters(computeVerticalScrollRange(),
                                computeVerticalScrollOffset(),
                                computeVerticalScrollExtent(), true);
        scrollBar.draw(canvas);
    }
    
    /**
     * <p>Draw the vertical scrollbar if {@link #isVerticalScrollBarEnabled()}
     * returns true.</p>
@@ -5441,13 +5453,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
        // TODO: Deal with RTL languages to position scrollbar on left
        final int left = scrollX + width - size - (mUserPaddingRight & inside);

        scrollBar.setBounds(left, scrollY + (mPaddingTop & inside),
                left + size, scrollY + height - (mUserPaddingBottom & inside));
        scrollBar.setParameters(
                computeVerticalScrollRange(),
                computeVerticalScrollOffset(),
                computeVerticalScrollExtent(), true);
        scrollBar.draw(canvas);
        onDrawVScrollBar(canvas, scrollBar,
                         left,
                         scrollY + (mPaddingTop & inside),
                         left + size,
                         scrollY + height - (mUserPaddingBottom & inside));
    }

    /**