mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-06 06:08:24 +08:00
fix progressbar' animation stopable
This commit is contained in:
parent
3596096e41
commit
30e98175b0
@ -418,9 +418,11 @@ void ProgressBar::setIndeterminate(bool indeterminate){
|
||||
// swap between indeterminate and regular backgrounds
|
||||
swapCurrentDrawable(mIndeterminateDrawable);
|
||||
startAnimation();
|
||||
} else {
|
||||
} else if(mProgressDrawable){
|
||||
swapCurrentDrawable(mProgressDrawable);
|
||||
stopAnimation();
|
||||
}else{
|
||||
stopAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -593,8 +595,8 @@ void ProgressBar::startAnimation() {
|
||||
}
|
||||
|
||||
void ProgressBar::stopAnimation() {
|
||||
if (dynamic_cast<Animatable*>(mIndeterminateDrawable)) {
|
||||
((Animatable*) mIndeterminateDrawable)->stop();
|
||||
if (dynamic_cast<AnimatedRotateDrawable*>(mIndeterminateDrawable)) {
|
||||
((AnimatedRotateDrawable*) mIndeterminateDrawable)->stop();
|
||||
mShouldStartAnimationDrawable = false;
|
||||
}
|
||||
postInvalidate();
|
||||
|
@ -376,6 +376,9 @@ TextView::TextView(Context*ctx,const AttributeSet& attrs)
|
||||
Drawable* end = attrs.getDrawable("drawableEnd");
|
||||
|
||||
setCompoundDrawablesWithIntrinsicBounds(left,top,right,bottom);
|
||||
if(mDrawables){
|
||||
mDrawables->mTintList =attrs.getColorStateList("drawableTint");
|
||||
}
|
||||
setRelativeDrawablesIfNeeded(start, end);
|
||||
|
||||
setCompoundDrawablePadding(attrs.getDimensionPixelSize("drawablePadding",0));
|
||||
|
Loading…
Reference in New Issue
Block a user