package androidx.lifecycle;

import android.view.View;
import androidx.core.view.f3;
import java.util.ArrayDeque;
import java.util.Queue;

/* JADX INFO: loaded from: classes.dex */
public final class e implements com.google.android.material.internal.u0 {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Object f2649d;

    public e() {
        this.f2646a = true;
        this.f2649d = new ArrayDeque();
    }

    public final void a() {
        Object obj = this.f2649d;
        if (this.f2648c) {
            return;
        }
        try {
            this.f2648c = true;
            while ((!((Queue) obj).isEmpty()) && (this.f2647b || !this.f2646a)) {
                Runnable runnable = (Runnable) ((Queue) obj).poll();
                if (runnable != null) {
                    runnable.run();
                }
            }
        } finally {
            this.f2648c = false;
        }
    }

    @Override // com.google.android.material.internal.u0
    public final f3 h(View view, f3 f3Var, com.google.android.material.internal.v0 v0Var) {
        if (this.f2646a) {
            v0Var.f22813d = f3Var.a() + v0Var.f22813d;
        }
        boolean z10 = view.getLayoutDirection() == 1;
        if (this.f2647b) {
            if (z10) {
                v0Var.f22812c = f3Var.b() + v0Var.f22812c;
            } else {
                v0Var.f22810a = f3Var.b() + v0Var.f22810a;
            }
        }
        if (this.f2648c) {
            if (z10) {
                v0Var.f22810a = f3Var.c() + v0Var.f22810a;
            } else {
                v0Var.f22812c = f3Var.c() + v0Var.f22812c;
            }
        }
        view.setPaddingRelative(v0Var.f22810a, v0Var.f22811b, v0Var.f22812c, v0Var.f22813d);
        com.google.android.material.internal.u0 u0Var = (com.google.android.material.internal.u0) this.f2649d;
        return u0Var != null ? u0Var.h(view, f3Var, v0Var) : f3Var;
    }

    public e(boolean z10, boolean z11, boolean z12, com.google.android.material.internal.u0 u0Var) {
        this.f2646a = z10;
        this.f2647b = z11;
        this.f2648c = z12;
        this.f2649d = u0Var;
    }
}
