Skip to content

Commit

Permalink
Prevent the PageIndicator from invalidating its content over and over…
Browse files Browse the repository at this point in the history
… again.

Closes #59
  • Loading branch information
Cyril Mottier committed Sep 20, 2011
1 parent b32df3b commit f5b0fd3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions GreenDroid/src/greendroid/widget/PageIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ protected void onDraw(Canvas canvas) {
if (mDotType == DotType.MULTIPLE || i == mActiveDot) {
state = mExtraState;
}
// HACK Cyril: The following code prevent the setState call
// from invalidating the View again (which will result in
// calling onDraw over and over again).
d.setCallback(null);
d.setState(state);
d.setCallback(this);
}
d.draw(canvas);
canvas.translate(mDotSpacing + d.getIntrinsicWidth(), 0);
Expand Down

0 comments on commit f5b0fd3

Please sign in to comment.