Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75c515ef authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Implement AnimatedImageDrawable.getColorFilter"

parents ff43d08e 8ed124d5
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ public class AnimatedImageDrawable extends Drawable implements Animatable2 {

    private Runnable mRunnable;

    private ColorFilter mColorFilter;

    /**
     *  Pass this to {@link #setLoopCount} to loop infinitely.
     *
@@ -276,10 +278,19 @@ public class AnimatedImageDrawable extends Drawable implements Animatable2 {
            throw new IllegalStateException("called setColorFilter on empty AnimatedImageDrawable");
        }

        if (colorFilter != mColorFilter) {
            mColorFilter = colorFilter;
            long nativeFilter = colorFilter == null ? 0 : colorFilter.getNativeInstance();
            nSetColorFilter(mState.mNativePtr, nativeFilter);
            invalidateSelf();
        }
    }

    @Override
    @Nullable
    public ColorFilter getColorFilter() {
        return mColorFilter;
    }

    @Override
    public @PixelFormat.Opacity int getOpacity() {