package com.google.android.material.shape;

import android.graphics.RectF;
import android.view.View;
import androidx.annotation.DoNotInline;

/* JADX INFO: loaded from: classes2.dex */
public final class j0 extends h0 {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f23089e = false;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public float f23090f = 0.0f;

    public j0(View view) {
        f(view);
    }

    @DoNotInline
    private void f(View view) {
        view.setOutlineProvider(new i0(this, 0));
    }

    @Override // com.google.android.material.shape.h0
    public final void a(View view) {
        boolean z10;
        s sVar;
        s sVar2;
        RectF rectF;
        s sVar3 = this.shapeAppearanceModel;
        this.f23090f = (sVar3 == null || (rectF = this.f23084c) == null) ? 0.0f : sVar3.f23156f.a(rectF);
        if (this.f23084c.isEmpty() || (sVar2 = this.shapeAppearanceModel) == null || !sVar2.g(this.f23084c)) {
            if (!this.f23084c.isEmpty() && (sVar = this.shapeAppearanceModel) != null && this.f23083b && !sVar.g(this.f23084c)) {
                s sVar4 = this.shapeAppearanceModel;
                if ((sVar4.f23151a instanceof p) && (sVar4.f23152b instanceof p) && (sVar4.f23154d instanceof p) && (sVar4.f23153c instanceof p)) {
                    float fA = sVar4.f23155e.a(this.f23084c);
                    float fA2 = this.shapeAppearanceModel.f23156f.a(this.f23084c);
                    float fA3 = this.shapeAppearanceModel.f23158h.a(this.f23084c);
                    float fA4 = this.shapeAppearanceModel.f23157g.a(this.f23084c);
                    if (fA == 0.0f && fA3 == 0.0f && fA2 == fA4) {
                        RectF rectF2 = this.f23084c;
                        rectF2.set(rectF2.left - fA2, rectF2.top, rectF2.right, rectF2.bottom);
                        this.f23090f = fA2;
                    } else if (fA == 0.0f && fA2 == 0.0f && fA3 == fA4) {
                        RectF rectF3 = this.f23084c;
                        rectF3.set(rectF3.left, rectF3.top - fA3, rectF3.right, rectF3.bottom);
                        this.f23090f = fA3;
                    } else if (fA2 == 0.0f && fA4 == 0.0f && fA == fA3) {
                        RectF rectF4 = this.f23084c;
                        rectF4.set(rectF4.left, rectF4.top, rectF4.right + fA, rectF4.bottom);
                        this.f23090f = fA;
                    } else if (fA3 == 0.0f && fA4 == 0.0f && fA == fA2) {
                        RectF rectF5 = this.f23084c;
                        rectF5.set(rectF5.left, rectF5.top, rectF5.right, rectF5.bottom + fA);
                        this.f23090f = fA;
                    }
                    z10 = true;
                }
            }
            z10 = false;
        } else {
            z10 = true;
        }
        this.f23089e = z10;
        view.setClipToOutline(!d());
        if (d()) {
            view.invalidate();
        } else {
            view.invalidateOutline();
        }
    }

    @Override // com.google.android.material.shape.h0
    public final boolean d() {
        return !this.f23089e || this.f23082a;
    }
}
