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

Commit 70fc6257 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 23828 into eclair

* changes:
  allow subclassing for drawing vertical scrollbar, so that clients (e.g. webview) can resize/position
parents f6190284 4d6fe5ff
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));
    }

    /**