Merge change 23828 into eclair
* changes: allow subclassing for drawing vertical scrollbar, so that clients (e.g. webview) can resize/position
This commit is contained in:
@@ -5409,6 +5409,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
|||||||
scrollBar.draw(canvas);
|
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()}
|
* <p>Draw the vertical scrollbar if {@link #isVerticalScrollBarEnabled()}
|
||||||
* returns true.</p>
|
* 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
|
// TODO: Deal with RTL languages to position scrollbar on left
|
||||||
final int left = scrollX + width - size - (mUserPaddingRight & inside);
|
final int left = scrollX + width - size - (mUserPaddingRight & inside);
|
||||||
|
|
||||||
scrollBar.setBounds(left, scrollY + (mPaddingTop & inside),
|
onDrawVScrollBar(canvas, scrollBar,
|
||||||
left + size, scrollY + height - (mUserPaddingBottom & inside));
|
left,
|
||||||
scrollBar.setParameters(
|
scrollY + (mPaddingTop & inside),
|
||||||
computeVerticalScrollRange(),
|
left + size,
|
||||||
computeVerticalScrollOffset(),
|
scrollY + height - (mUserPaddingBottom & inside));
|
||||||
computeVerticalScrollExtent(), true);
|
|
||||||
scrollBar.draw(canvas);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user