Skip to content

Commit

Permalink
Tiny optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Aug 7, 2011
1 parent 99b4f90 commit 9cff69f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/res/values/defaults.xml
Expand Up @@ -21,7 +21,7 @@
<bool name="default_circle_indicator_snap">false</bool>
<color name="default_circle_indicator_stroke_color">#FFDDDDDD</color>

<dimen name="default_title_indicator_clip_padding">0dp</dimen>
<dimen name="default_title_indicator_clip_padding">4dp</dimen>
<color name="default_title_indicator_footer_color">#FF6899FF</color>
<dimen name="default_title_indicator_footer_line_height">1px</dimen>
<integer name="default_title_indicator_footer_indicator_style">1</integer>
Expand Down
Expand Up @@ -269,9 +269,9 @@ protected void onDraw(Canvas canvas) {
if (mCurrentPage > 0) {
for (int i = mCurrentPage - 1; i >= 0; i--) {
Rect bound = bounds.get(i);
int w = bound.right - bound.left;
//Is left side is outside the screen
if (bound.left < 0) {
int w = bound.right - bound.left;
//Try to clip to the screen (left side)
clipViewOnTheLeft(bound, w);
//Except if there's an intersection with the right view
Expand All @@ -289,9 +289,9 @@ protected void onDraw(Canvas canvas) {
if (mCurrentPage < countMinusOne) {
for (int i = mCurrentPage + 1 ; i < count; i++) {
Rect bound = bounds.get(i);
int w = bound.right - bound.left;
//If right side is outside the screen
if (bound.right > leftPlusWidth) {
int w = bound.right - bound.left;
//Try to clip to the screen (right side)
clipViewOnTheRight(bound, w, leftPlusWidth);
//Except if there's an intersection with the left view
Expand Down

0 comments on commit 9cff69f

Please sign in to comment.