package ඓ.ῲ.K.ᕣ.ᕣ.ⁱ;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import java.nio.ByteBuffer;
import java.util.List;
import ඓ.ῲ.K.ᕣ.ᕣ.ⁱ.C0906;
import ῲ.ᨨ.㳳.C1841;
import ῲ.㴪.K.K.AbstractC2258;

/* renamed from: ඓ.ῲ.K.ᕣ.ᕣ.ⁱ.ʬ  reason: contains not printable characters */
/* compiled from: GifDrawable */
public class C0901 extends Drawable implements C0906.AbstractC0908, Animatable, AbstractC2258 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean f4155;

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean f4156;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public Rect f4157;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public boolean f4158;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C0902 f4159;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f4160;

    /* renamed from: 㑃  reason: contains not printable characters */
    public List<AbstractC2258.AbstractC2259> f4161;

    /* renamed from: 㳳  reason: contains not printable characters */
    public Paint f4162;

    /* renamed from: 㴹  reason: contains not printable characters */
    public boolean f4163 = true;

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean f4164;

    /* renamed from: 㿎  reason: contains not printable characters */
    public int f4165 = -1;

    /* renamed from: ඓ.ῲ.K.ᕣ.ᕣ.ⁱ.ʬ$K  reason: contains not printable characters */
    /* compiled from: GifDrawable */
    public static final class C0902 extends Drawable.ConstantState {

        /* renamed from: K  reason: contains not printable characters */
        public final C0906 f4166;

        public C0902(C0906 r1) {
            this.f4166 = r1;
        }

        public int getChangingConfigurations() {
            return 0;
        }

        public Drawable newDrawable() {
            return new C0901(this);
        }

        public Drawable newDrawable(Resources resources) {
            return new C0901(this);
        }
    }

    public C0901(C0902 k) {
        C1841.m4783(k, "Argument must not be null");
        this.f4159 = k;
    }

    public void draw(Canvas canvas) {
        if (!this.f4156) {
            if (this.f4158) {
                int intrinsicWidth = getIntrinsicWidth();
                int intrinsicHeight = getIntrinsicHeight();
                Rect bounds = getBounds();
                if (this.f4157 == null) {
                    this.f4157 = new Rect();
                }
                Gravity.apply(119, intrinsicWidth, intrinsicHeight, bounds, this.f4157);
                this.f4158 = false;
            }
            Bitmap r0 = this.f4159.f4166.m2594();
            if (this.f4157 == null) {
                this.f4157 = new Rect();
            }
            canvas.drawBitmap(r0, (Rect) null, this.f4157, m2586());
        }
    }

    public Drawable.ConstantState getConstantState() {
        return this.f4159;
    }

    public int getIntrinsicHeight() {
        return this.f4159.f4166.m2599();
    }

    public int getIntrinsicWidth() {
        return this.f4159.f4166.m2596();
    }

    public int getOpacity() {
        return -2;
    }

    public boolean isRunning() {
        return this.f4155;
    }

    public void onBoundsChange(Rect rect) {
        super.onBoundsChange(rect);
        this.f4158 = true;
    }

    public void setAlpha(int i) {
        m2586().setAlpha(i);
    }

    public void setColorFilter(ColorFilter colorFilter) {
        m2586().setColorFilter(colorFilter);
    }

    public boolean setVisible(boolean z, boolean z2) {
        C1841.m4796(!this.f4156, "Cannot change the visibility of a recycled resource. Ensure that you unset the Drawable from your View before changing the View's visibility.");
        this.f4163 = z;
        if (!z) {
            this.f4155 = false;
            this.f4159.f4166.m2598(this);
        } else if (this.f4164) {
            m2589();
        }
        return super.setVisible(z, z2);
    }

    public void start() {
        this.f4164 = true;
        this.f4160 = 0;
        if (this.f4163) {
            m2589();
        }
    }

    public void stop() {
        this.f4164 = false;
        this.f4155 = false;
        this.f4159.f4166.m2598(this);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Paint m2586() {
        if (this.f4162 == null) {
            this.f4162 = new Paint(2);
        }
        return this.f4162;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public Bitmap m2587() {
        return this.f4159.f4166.m2595();
    }

    /* renamed from: K  reason: contains not printable characters */
    public ByteBuffer m2588() {
        return this.f4159.f4166.m2597();
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public final void m2589() {
        C1841.m4796(!this.f4156, "You cannot start a recycled Drawable. Ensure thatyou clear any references to the Drawable when clearing the corresponding request.");
        if (this.f4159.f4166.m2605() == 1) {
            invalidateSelf();
        } else if (!this.f4155) {
            this.f4155 = true;
            this.f4159.f4166.m2601(this);
            invalidateSelf();
        }
    }
}
