package o;

import android.os.Build;
import android.view.View;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class OH extends AbstractC2071oh implements Runnable, InterfaceC2904xT, View.OnAttachStateChangeListener {
    public final Pl0 n;

    /* renamed from: o, reason: collision with root package name */
    public boolean f267o;
    public boolean p;
    public Kl0 q;

    public OH(Pl0 pl0) {
        super(!pl0.r ? 1 : 0);
        this.n = pl0;
    }

    @Override // o.AbstractC2071oh
    public final void d(C2554tl0 c2554tl0) {
        this.f267o = false;
        this.p = false;
        Kl0 kl0 = this.q;
        if (c2554tl0.a.b() > 0 && kl0 != null) {
            Hl0 hl0 = kl0.a;
            Pl0 pl0 = this.n;
            pl0.q.f(AbstractC0752ap.h0(hl0.g(8)));
            pl0.p.f(AbstractC0752ap.h0(hl0.g(8)));
            Pl0.a(pl0, kl0);
        }
        this.q = null;
    }

    @Override // o.AbstractC2071oh
    public final void e() {
        this.f267o = true;
        this.p = true;
    }

    @Override // o.AbstractC2071oh
    public final Kl0 f(Kl0 kl0, List list) {
        Pl0 pl0 = this.n;
        Pl0.a(pl0, kl0);
        return pl0.r ? Kl0.b : kl0;
    }

    @Override // o.AbstractC2071oh
    public final C3040yr g(C2554tl0 c2554tl0, C3040yr c3040yr) {
        this.f267o = false;
        return c3040yr;
    }

    @Override // o.InterfaceC2904xT
    public final Kl0 i(View view, Kl0 kl0) {
        this.q = kl0;
        Pl0 pl0 = this.n;
        Ai0 ai0 = pl0.p;
        Hl0 hl0 = kl0.a;
        ai0.f(AbstractC0752ap.h0(hl0.g(8)));
        if (this.f267o) {
            if (Build.VERSION.SDK_INT == 30) {
                view.post(this);
            }
        } else if (!this.p) {
            pl0.q.f(AbstractC0752ap.h0(hl0.g(8)));
            Pl0.a(pl0, kl0);
        }
        return pl0.r ? Kl0.b : kl0;
    }

    @Override // android.view.View.OnAttachStateChangeListener
    public final void onViewAttachedToWindow(View view) {
        view.requestApplyInsets();
    }

    @Override // java.lang.Runnable
    public final void run() {
        if (this.f267o) {
            this.f267o = false;
            this.p = false;
            Kl0 kl0 = this.q;
            if (kl0 != null) {
                Pl0 pl0 = this.n;
                pl0.q.f(AbstractC0752ap.h0(kl0.a.g(8)));
                Pl0.a(pl0, kl0);
                this.q = null;
            }
        }
    }

    @Override // android.view.View.OnAttachStateChangeListener
    public final void onViewDetachedFromWindow(View view) {
    }
}
