package eightbitlab.com.blurview;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import q6.b;
import vc.a;
import vc.d;
import vc.g;

/* JADX INFO: loaded from: classes.dex */
public class BlurView extends FrameLayout {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public a f25885a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f25886b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final boolean f25887c;

    public BlurView(Context context) {
        super(context);
        this.f25885a = new d();
        this.f25887c = true;
        a(null, 0);
    }

    public final void a(AttributeSet attributeSet, int i10) {
        TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, b.BlurView, i10, 0);
        this.f25886b = typedArrayObtainStyledAttributes.getColor(b.BlurView_blurOverlayColor, 0);
        typedArrayObtainStyledAttributes.recycle();
    }

    @Override // android.view.View
    public final void draw(Canvas canvas) {
        if (this.f25885a.d(canvas)) {
            super.draw(canvas);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (isHardwareAccelerated()) {
            this.f25885a.a(this.f25887c);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        this.f25885a.a(false);
    }

    @Override // android.view.View
    public final void onSizeChanged(int i10, int i11, int i12, int i13) {
        super.onSizeChanged(i10, i11, i12, i13);
        this.f25885a.c();
    }

    @Override // android.view.View
    public void setRotation(float f10) {
        super.setRotation(f10);
        a aVar = this.f25885a;
        if (aVar instanceof g) {
            ((g) aVar).f33793e.setRotationZ(-f10);
        }
    }

    public BlurView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f25885a = new d();
        this.f25887c = true;
        a(attributeSet, 0);
    }

    public BlurView(Context context, AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        this.f25885a = new d();
        this.f25887c = true;
        a(attributeSet, i10);
    }
}
