package fd;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import androidx.databinding.n;
import androidx.lifecycle.a0;
import androidx.lifecycle.f0;
import ca.canadapost.core.common.customView.CpcTextInput;
import kd.a;

/* loaded from: classes4.dex */
public class p extends o implements a.InterfaceC0545a {
    private static final n.i H = null;
    private static final SparseIntArray I = null;
    private final LinearLayout C;
    private final Button D;
    private final View.OnClickListener E;
    private androidx.databinding.g F;
    private long G;

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

        @Override // androidx.databinding.g
        public void a() {
            String a10 = ca.canadapost.core.common.customView.u.a(p.this.A);
            hd.i iVar = p.this.B;
            if (iVar != null) {
                f0 R = iVar.R();
                if (R != null) {
                    R.q(a10);
                }
            }
        }
    }

    public p(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 3, H, I));
    }

    private boolean U(f0 f0Var, int i10) {
        if (i10 != ed.a.f16891a) {
            return false;
        }
        synchronized (this) {
            this.G |= 1;
        }
        return true;
    }

    private boolean V(a0 a0Var, int i10) {
        if (i10 != ed.a.f16891a) {
            return false;
        }
        synchronized (this) {
            this.G |= 2;
        }
        return true;
    }

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (ed.a.f16892b != i10) {
            return false;
        }
        W((hd.i) obj);
        return true;
    }

    public void W(hd.i iVar) {
        this.B = iVar;
        synchronized (this) {
            this.G |= 4;
        }
        f(ed.a.f16892b);
        super.J();
    }

    @Override // kd.a.InterfaceC0545a
    public final void a(int i10, View view) {
        hd.i iVar = this.B;
        if (iVar != null) {
            iVar.W();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        f0 f0Var;
        synchronized (this) {
            j10 = this.G;
            this.G = 0L;
        }
        hd.i iVar = this.B;
        String str = null;
        if ((15 & j10) != 0) {
            if ((j10 & 13) != 0) {
                f0Var = iVar != null ? iVar.R() : null;
                S(0, f0Var);
                if (f0Var != null) {
                }
            } else {
                f0Var = null;
            }
            if ((j10 & 14) != 0) {
                a0 S = iVar != null ? iVar.S() : null;
                S(1, S);
                if (S != null) {
                    str = (String) S.f();
                }
            }
        } else {
            f0Var = null;
        }
        if ((8 & j10) != 0) {
            this.D.setOnClickListener(this.E);
            ca.canadapost.core.common.customView.u.e(this.A, this.F);
        }
        if ((14 & j10) != 0) {
            ca.canadapost.core.common.customView.u.d(this.A, str);
        }
        if ((j10 & 13) != 0) {
            ca.canadapost.core.common.customView.u.b(this.A, f0Var);
        }
    }

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

    private p(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 2, (CpcTextInput) objArr[1]);
        this.F = new a();
        this.G = -1L;
        LinearLayout linearLayout = (LinearLayout) objArr[0];
        this.C = linearLayout;
        linearLayout.setTag(null);
        Button button = (Button) objArr[2];
        this.D = button;
        button.setTag(null);
        this.A.setTag(null);
        P(view);
        this.E = new kd.a(this, 1);
        B();
    }
}
