Loading graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +18 −7 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac private void init() { final AnimatedRotateState state = mState; mIncrement = 360.0f / (float) state.mFramesCount; mIncrement = 360.0f / state.mFramesCount; final Drawable drawable = state.mDrawable; if (drawable != null) { drawable.setFilterBitmap(true); Loading @@ -65,6 +65,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac } } @Override public void draw(Canvas canvas) { int saveCount = canvas.save(); Loading Loading @@ -146,14 +147,17 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac | mState.mDrawable.getChangingConfigurations(); } @Override public void setAlpha(int alpha) { mState.mDrawable.setAlpha(alpha); } @Override public void setColorFilter(ColorFilter cf) { mState.mDrawable.setColorFilter(cf); } @Override public int getOpacity() { return mState.mDrawable.getOpacity(); } Loading Loading @@ -229,8 +233,8 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac final boolean pivotYRel = tv.type == TypedValue.TYPE_FRACTION; final float pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); final int framesCount = a.getInt(R.styleable.AnimatedRotateDrawable_framesCount, 12); final int frameDuration = a.getInt(R.styleable.AnimatedRotateDrawable_frameDuration, 150); setFramesCount(a.getInt(R.styleable.AnimatedRotateDrawable_framesCount, 12)); setFramesDuration(a.getInt(R.styleable.AnimatedRotateDrawable_frameDuration, 150)); final int res = a.getResourceId(R.styleable.AnimatedRotateDrawable_drawable, 0); Drawable drawable = null; Loading Loading @@ -265,8 +269,6 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac rotateState.mPivotX = pivotX; rotateState.mPivotYRel = pivotYRel; rotateState.mPivotY = pivotY; rotateState.mFramesCount = framesCount; rotateState.mFrameDuration = frameDuration; init(); Loading @@ -275,6 +277,15 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac } } public void setFramesCount(int framesCount) { mState.mFramesCount = framesCount; mIncrement = 360.0f / mState.mFramesCount; } public void setFramesDuration(int framesDuration) { mState.mFrameDuration = framesDuration; } @Override public Drawable mutate() { if (!mMutated && super.mutate() == this) { Loading Loading
graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +18 −7 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac private void init() { final AnimatedRotateState state = mState; mIncrement = 360.0f / (float) state.mFramesCount; mIncrement = 360.0f / state.mFramesCount; final Drawable drawable = state.mDrawable; if (drawable != null) { drawable.setFilterBitmap(true); Loading @@ -65,6 +65,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac } } @Override public void draw(Canvas canvas) { int saveCount = canvas.save(); Loading Loading @@ -146,14 +147,17 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac | mState.mDrawable.getChangingConfigurations(); } @Override public void setAlpha(int alpha) { mState.mDrawable.setAlpha(alpha); } @Override public void setColorFilter(ColorFilter cf) { mState.mDrawable.setColorFilter(cf); } @Override public int getOpacity() { return mState.mDrawable.getOpacity(); } Loading Loading @@ -229,8 +233,8 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac final boolean pivotYRel = tv.type == TypedValue.TYPE_FRACTION; final float pivotY = pivotYRel ? tv.getFraction(1.0f, 1.0f) : tv.getFloat(); final int framesCount = a.getInt(R.styleable.AnimatedRotateDrawable_framesCount, 12); final int frameDuration = a.getInt(R.styleable.AnimatedRotateDrawable_frameDuration, 150); setFramesCount(a.getInt(R.styleable.AnimatedRotateDrawable_framesCount, 12)); setFramesDuration(a.getInt(R.styleable.AnimatedRotateDrawable_frameDuration, 150)); final int res = a.getResourceId(R.styleable.AnimatedRotateDrawable_drawable, 0); Drawable drawable = null; Loading Loading @@ -265,8 +269,6 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac rotateState.mPivotX = pivotX; rotateState.mPivotYRel = pivotYRel; rotateState.mPivotY = pivotY; rotateState.mFramesCount = framesCount; rotateState.mFrameDuration = frameDuration; init(); Loading @@ -275,6 +277,15 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac } } public void setFramesCount(int framesCount) { mState.mFramesCount = framesCount; mIncrement = 360.0f / mState.mFramesCount; } public void setFramesDuration(int framesDuration) { mState.mFrameDuration = framesDuration; } @Override public Drawable mutate() { if (!mMutated && super.mutate() == this) { Loading