package zb;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.databinding.n;
import bc.a;

/* loaded from: classes4.dex */
public class r2 extends q2 implements a.InterfaceC0178a {
    private static final n.i I = null;
    private static final SparseIntArray J = null;
    private final ConstraintLayout D;
    private final TextView E;
    private final CompoundButton.OnCheckedChangeListener F;
    private androidx.databinding.g G;
    private long H;

    /* loaded from: classes4.dex */
    class a implements androidx.databinding.g {
        a() {
        }

        @Override // androidx.databinding.g
        public void a() {
            boolean isChecked = r2.this.A.isChecked();
            wb.n nVar = r2.this.C;
            if (nVar != null) {
                androidx.lifecycle.f0 e10 = nVar.e();
                if (e10 != null) {
                    e10.q(Boolean.valueOf(isChecked));
                }
            }
        }
    }

    public r2(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 4, I, J));
    }

    private boolean U(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != ob.a.f31092a) {
            return false;
        }
        synchronized (this) {
            this.H |= 1;
        }
        return true;
    }

    @Override // androidx.databinding.n
    public void B() {
        synchronized (this) {
            this.H = 4L;
        }
        J();
    }

    @Override // androidx.databinding.n
    protected boolean F(int i10, Object obj, int i11) {
        if (i10 != 0) {
            return false;
        }
        return U((androidx.lifecycle.f0) obj, i11);
    }

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (ob.a.f31097f != i10) {
            return false;
        }
        V((wb.n) obj);
        return true;
    }

    public void V(wb.n nVar) {
        this.C = nVar;
        synchronized (this) {
            this.H |= 2;
        }
        f(ob.a.f31097f);
        super.J();
    }

    @Override // bc.a.InterfaceC0178a
    public final void b(int i10, CompoundButton compoundButton, boolean z10) {
        wb.n nVar = this.C;
        if (nVar != null) {
            nVar.f(z10);
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        String str;
        String str2;
        synchronized (this) {
            j10 = this.H;
            this.H = 0L;
        }
        wb.n nVar = this.C;
        long j11 = 7 & j10;
        boolean z10 = false;
        String str3 = null;
        if (j11 != 0) {
            if ((j10 & 6) == 0 || nVar == null) {
                str2 = null;
                str = null;
            } else {
                str2 = nVar.c();
                str = nVar.d();
            }
            androidx.lifecycle.f0 e10 = nVar != null ? nVar.e() : null;
            S(0, e10);
            z10 = androidx.databinding.n.M(e10 != null ? (Boolean) e10.f() : null);
            str3 = str2;
        } else {
            str = null;
        }
        if (j11 != 0) {
            b4.a.a(this.A, z10);
        }
        if ((4 & j10) != 0) {
            b4.a.b(this.A, this.F, this.G);
        }
        if ((j10 & 6) != 0) {
            b4.e.e(this.E, str3);
            b4.e.e(this.B, str);
        }
    }

    @Override // androidx.databinding.n
    public boolean z() {
        synchronized (this) {
            return this.H != 0;
        }
    }

    private r2(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 1, (SwitchCompat) objArr[3], (TextView) objArr[1]);
        this.G = new a();
        this.H = -1L;
        this.A.setTag(null);
        ConstraintLayout constraintLayout = (ConstraintLayout) objArr[0];
        this.D = constraintLayout;
        constraintLayout.setTag(null);
        TextView textView = (TextView) objArr[2];
        this.E = textView;
        textView.setTag(null);
        this.B.setTag(null);
        P(view);
        this.F = new bc.a(this, 1);
        B();
    }
}
