@@ -62,6 +62,7 @@ public void run() {
62
62
int mMaxHeight ;
63
63
64
64
private Indicator mIndicator ;
65
+ private int mIndicatorColor ;
65
66
66
67
private boolean mShouldStartAnimationDrawable ;
67
68
@@ -100,12 +101,11 @@ private void init(Context context,AttributeSet attrs,int defStyleAttr, int defSt
100
101
mMinHeight = a .getDimensionPixelSize (R .styleable .AVLoadingIndicatorView_minHeight , mMinHeight );
101
102
mMaxHeight = a .getDimensionPixelSize (R .styleable .AVLoadingIndicatorView_maxHeight , mMaxHeight );
102
103
String indicatorName =a .getString (R .styleable .AVLoadingIndicatorView_indicatorName );
103
- int indicatorColor =a .getColor (R .styleable .AVLoadingIndicatorView_indicatorColor , Color .WHITE );
104
+ mIndicatorColor =a .getColor (R .styleable .AVLoadingIndicatorView_indicatorColor , Color .WHITE );
104
105
setIndicator (indicatorName );
105
106
if (mIndicator ==null ){
106
107
setIndicator (DEFAULT_INDICATOR );
107
108
}
108
- setIndicatorColor (indicatorColor );
109
109
a .recycle ();
110
110
}
111
111
@@ -121,14 +121,16 @@ public void setIndicator(Indicator d) {
121
121
}
122
122
123
123
mIndicator = d ;
124
-
124
+ //need to set indicator color again if you didn't specified when you update the indicator .
125
+ setIndicatorColor (mIndicatorColor );
125
126
if (d != null ) {
126
127
d .setCallback (this );
127
128
}
128
129
postInvalidate ();
129
130
}
130
131
}
131
132
133
+
132
134
/**
133
135
* setIndicatorColor(0xFF00FF00)
134
136
* or
@@ -142,6 +144,7 @@ public void setIndicator(Indicator d) {
142
144
* @param color
143
145
*/
144
146
public void setIndicatorColor (int color ){
147
+ this .mIndicatorColor =color ;
145
148
mIndicator .setColor (color );
146
149
}
147
150
0 commit comments