Skip to content

Commit

Permalink
Make sure the mExtraState array is not null
Browse files Browse the repository at this point in the history
mExtraState was previously only initialized by a drawableStateChanged() method. Unfortunately, there are some cases were this method is not called during a View initialization. In those cases the selected dot was never drawn as selected (mExtraState was null in the onDraw)
  • Loading branch information
Cyril Mottier committed Jun 23, 2011
1 parent 668116f commit 2688f5b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GreenDroid/src/greendroid/widget/PageIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ private void initPageIndicator() {
mActiveDot = 0;
mDotSpacing = 0;
mDotType = DotType.SINGLE;

mExtraState = onCreateDrawableState(1);
mergeDrawableStates(mExtraState, SELECTED_STATE_SET);
}

/**
Expand Down

0 comments on commit 2688f5b

Please sign in to comment.