@@ -175,18 +175,17 @@ private void updateMarginBottom() {
175
175
*
176
176
* @param state The state of this stepper item
177
177
*/
178
- @ SuppressLint ("NewApi" )
179
178
public synchronized void setState (@ State int state ) {
180
179
// Change point background
181
180
if (mPointColorAnimator != null ) mPointColorAnimator .cancel ();
182
181
if (state != STATE_NORMAL && mState == STATE_NORMAL ) {
183
- mPointColorAnimator = ObjectAnimator
184
- . ofArgb ( mPointBackground , "backgroundColor" , mNormalColor , mActivatedColor );
182
+ mPointColorAnimator = ViewUtils . createArgbAnimator (
183
+ mPointBackground , "backgroundColor" , mNormalColor , mActivatedColor );
185
184
mPointColorAnimator .setDuration (mAnimationDuration );
186
185
mPointColorAnimator .start ();
187
186
} else if (state == STATE_NORMAL && mState != STATE_NORMAL ) {
188
- mPointColorAnimator = ObjectAnimator
189
- . ofArgb ( mPointBackground , "backgroundColor" , mActivatedColor , mNormalColor );
187
+ mPointColorAnimator = ViewUtils . createArgbAnimator (
188
+ mPointBackground , "backgroundColor" , mActivatedColor , mNormalColor );
190
189
mPointColorAnimator .setDuration (mAnimationDuration );
191
190
mPointColorAnimator .start ();
192
191
} else {
@@ -217,15 +216,13 @@ public synchronized void setState(@State int state) {
217
216
218
217
// Update error state
219
218
if (mErrorText != null ) {
220
- mTitleColorAnimator = ObjectAnimator
221
- .ofArgb (mTitleText , "textColor" ,
222
- lastTitleTextColor , mErrorColor );
219
+ mTitleColorAnimator = ViewUtils .createArgbAnimator (
220
+ mTitleText , "textColor" , lastTitleTextColor , mErrorColor );
223
221
mTitleColorAnimator .setDuration (mAnimationDuration );
224
222
mTitleColorAnimator .start ();
225
223
if (mSummaryColorAnimator != null ) mSummaryColorAnimator .cancel ();
226
- mSummaryColorAnimator = ObjectAnimator
227
- .ofArgb (mSummaryText , "textColor" ,
228
- mSummaryText .getCurrentTextColor (), mErrorColor );
224
+ mSummaryColorAnimator = ViewUtils .createArgbAnimator (
225
+ mSummaryText , "textColor" , mSummaryText .getCurrentTextColor (), mErrorColor );
229
226
mSummaryColorAnimator .setDuration (mAnimationDuration );
230
227
mSummaryColorAnimator .start ();
231
228
@@ -242,9 +239,8 @@ public synchronized void setState(@State int state) {
242
239
}
243
240
} else {
244
241
if (mSummaryColorAnimator != null ) mSummaryColorAnimator .cancel ();
245
- mSummaryColorAnimator = ObjectAnimator
246
- .ofArgb (mSummaryText , "textColor" ,
247
- mSummaryText .getCurrentTextColor (), mLineColor );
242
+ mSummaryColorAnimator = ViewUtils .createArgbAnimator (
243
+ mSummaryText , "textColor" , mSummaryText .getCurrentTextColor (), mLineColor );
248
244
mSummaryColorAnimator .setDuration (mAnimationDuration );
249
245
mSummaryColorAnimator .start ();
250
246
0 commit comments