package n;

import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import androidx.appcompat.widget.Toolbar;

/* JADX INFO: loaded from: classes.dex */
public final class Q0 implements Q {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Drawable f14764d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Drawable f14765e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public Drawable f14766f;

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public CharSequence f14768h;
    public CharSequence i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public CharSequence f14769j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public Window.Callback f14770k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f14771l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public Drawable f14772m;

    public final void a(int i) {
        View view;
        int i5 = this.f14762b ^ i;
        this.f14762b = i;
        if (i5 != 0) {
            if ((i5 & 4) != 0) {
                if ((i & 4) != 0) {
                    b();
                }
                int i8 = this.f14762b & 4;
                Toolbar toolbar = this.f14761a;
                if (i8 != 0) {
                    Drawable drawable = this.f14766f;
                    if (drawable == null) {
                        drawable = this.f14772m;
                    }
                    toolbar.setNavigationIcon(drawable);
                } else {
                    toolbar.setNavigationIcon((Drawable) null);
                }
            }
            if ((i5 & 3) != 0) {
                c();
            }
            int i9 = i5 & 8;
            Toolbar toolbar2 = this.f14761a;
            if (i9 != 0) {
                if ((i & 8) != 0) {
                    toolbar2.setTitle(this.f14768h);
                    toolbar2.setSubtitle(this.i);
                } else {
                    toolbar2.setTitle((CharSequence) null);
                    toolbar2.setSubtitle((CharSequence) null);
                }
            }
            if ((i5 & 16) == 0 || (view = this.f14763c) == null) {
                return;
            }
            if ((i & 16) != 0) {
                toolbar2.addView(view);
            } else {
                toolbar2.removeView(view);
            }
        }
    }

    public final void b() {
        if ((this.f14762b & 4) != 0) {
            boolean zIsEmpty = TextUtils.isEmpty(this.f14769j);
            Toolbar toolbar = this.f14761a;
            if (zIsEmpty) {
                toolbar.setNavigationContentDescription(this.f14771l);
            } else {
                toolbar.setNavigationContentDescription(this.f14769j);
            }
        }
    }

    public final void c() {
        Drawable drawable;
        int i = this.f14762b;
        if ((i & 2) == 0) {
            drawable = null;
        } else if ((i & 1) == 0 || (drawable = this.f14765e) == null) {
            drawable = this.f14764d;
        }
        this.f14761a.setLogo(drawable);
    }
}
