fix animatedrotatedrawable's animation(cannt stopped in progressbar)

This commit is contained in:
houzh 2023-12-04 19:06:43 +08:00
parent 0f749cafbe
commit 9cbcc5b406

View File

@ -116,8 +116,10 @@ bool AnimatedRotateDrawable::isRunning() {
void AnimatedRotateDrawable::nextFrame() {
unscheduleSelf(mNextFrame);
scheduleSelf(mNextFrame,SystemClock::uptimeMillis()+mState->mFrameDuration);
mCurrentDegrees += mIncrement;
if(mRunning){
scheduleSelf(mNextFrame,SystemClock::uptimeMillis()+mState->mFrameDuration);
mCurrentDegrees += mIncrement;
}
}
bool AnimatedRotateDrawable::setVisible(bool visible, bool restart){