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

Commit 8ed124d5 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Implement AnimatedImageDrawable.getColorFilter

Test: CTS: Ie9766f24164d6b035944b1fe82c2d285482ad1d2

Change-Id: I7f2cb0da918ae67c7a5906a478012fa25678294c
parent db4c5bc8
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() {