@@ -47,16 +47,16 @@ public final class TutorialPageIndicator extends View implements TutorialImpl.In
47
47
static final int DEFAULT_VALUE = 0 ;
48
48
static final int NO_COLOR = 1 ;
49
49
@ ColorInt
50
- static final int DEFAULT_COLOR = Color .TRANSPARENT ;
50
+ static final int DEFAULT_COLOR = Color .RED ;
51
51
52
- private RectF mClipBounds ;
53
- private RectF mElementBounds ;
52
+ private final RectF mClipBounds = new RectF () ;
53
+ private final RectF mElementBounds = new RectF () ;
54
54
private float mScrolledOffset ;
55
55
private int mSelectedPosition ;
56
56
private float mIndicatorElementSpacing ;
57
57
private float mIndicatorElementSize ;
58
- private Paint mIndicatorSelectedPaint ;
59
- private Paint mIndicatorPaint ;
58
+ private final Paint mIndicatorSelectedPaint = new Paint () ;
59
+ private final Paint mIndicatorPaint = new Paint () ;
60
60
private Renderer mRenderer ;
61
61
private int mPagesCount ;
62
62
private boolean mIsInfiniteScroll ;
@@ -79,10 +79,6 @@ public TutorialPageIndicator(Context context, AttributeSet attrs, int defStyleAt
79
79
}
80
80
81
81
void initWith (@ NonNull IndicatorOptions indicatorOptions , int pagesCount ) {
82
- mElementBounds = new RectF ();
83
- mClipBounds = new RectF ();
84
-
85
- mIndicatorPaint = new Paint ();
86
82
mIndicatorPaint .setAntiAlias (true );
87
83
int elementColor ;
88
84
if (indicatorOptions .getElementColor () != NO_COLOR ) {
@@ -92,7 +88,6 @@ void initWith(@NonNull IndicatorOptions indicatorOptions, int pagesCount) {
92
88
}
93
89
mIndicatorPaint .setColor (elementColor );
94
90
95
- mIndicatorSelectedPaint = new Paint ();
96
91
mIndicatorSelectedPaint .setAntiAlias (true );
97
92
int selectedElementColor ;
98
93
if (indicatorOptions .getSelectedElementColor () != NO_COLOR ) {
0 commit comments