Skip to content

Commit

Permalink
fix force close when add view dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
aliab committed Nov 20, 2016
1 parent 92e2742 commit 5476200
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public CircularMusicProgressBar(Context context, AttributeSet attrs, int defStyl
mProgressColor = a.getColor(R.styleable.CircularMusicProgressBar_progress_color, DEFAULT_PROGRESS_COLOR);
mBaseStartAngle = a.getFloat(R.styleable.CircularMusicProgressBar_progress_startAngle, 0);

a.recycle();
init();
}

private void init() {

// init animator
mValueAnimator = ValueAnimator.ofFloat(0, mProgressValue);
mValueAnimator.setDuration(DEFAULT_ANIMATION_TIME);
Expand All @@ -107,11 +113,6 @@ public void onAnimationUpdate(ValueAnimator valueAnimator) {
}
});

a.recycle();
init();
}

private void init() {
super.setScaleType(SCALE_TYPE);
mReady = true;

Expand Down

0 comments on commit 5476200

Please sign in to comment.