package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.widget.ActionMenuView;
import java.util.ArrayList;
import java.util.List;
import p037.p041.C1468;
import p037.p041.C1477;
import p037.p041.p042.AbstractC1478;
import p037.p041.p043.p044.C1527;
import p037.p041.p049.C1554;
import p037.p041.p049.InterfaceC1549;
import p037.p041.p049.p050.C1572;
import p037.p041.p049.p050.C1576;
import p037.p041.p049.p050.InterfaceC1587;
import p037.p041.p049.p050.SubMenuC1596;
import p037.p041.p051.C1601;
import p037.p041.p051.C1618;
import p037.p041.p051.C1642;
import p037.p041.p051.C1679;
import p037.p041.p051.C1689;
import p037.p041.p051.C1691;
import p037.p041.p051.C1698;
import p037.p041.p051.InterfaceC1649;
import p037.p065.p078.C1920;
import p037.p083.p084.AbstractC1974;

/* JADX INFO: loaded from: classes.dex */
public class Toolbar extends ViewGroup {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public ActionMenuView f436;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public TextView f437;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public TextView f438;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public ImageButton f439;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public ImageView f440;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public Drawable f441;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public CharSequence f442;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public ImageButton f443;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public View f444;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public Context f445;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public int f446;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public int f447;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public int f448;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public int f449;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public int f450;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public int f451;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public int f452;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public int f453;

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public int f454;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public C1679 f455;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public int f456;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public int f457;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public int f458;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public CharSequence f459;

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public CharSequence f460;

    /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
    public ColorStateList f461;

    /* JADX INFO: renamed from: ޝ, reason: contains not printable characters */
    public ColorStateList f462;

    /* JADX INFO: renamed from: ޞ, reason: contains not printable characters */
    public boolean f463;

    /* JADX INFO: renamed from: ޟ, reason: contains not printable characters */
    public boolean f464;

    /* JADX INFO: renamed from: ޠ, reason: contains not printable characters */
    public final ArrayList<View> f465;

    /* JADX INFO: renamed from: ޡ, reason: contains not printable characters */
    public final ArrayList<View> f466;

    /* JADX INFO: renamed from: ޢ, reason: contains not printable characters */
    public final int[] f467;

    /* JADX INFO: renamed from: ޣ, reason: contains not printable characters */
    public InterfaceC0071 f468;

    /* JADX INFO: renamed from: ޤ, reason: contains not printable characters */
    public final ActionMenuView.InterfaceC0045 f469;

    /* JADX INFO: renamed from: ޥ, reason: contains not printable characters */
    public C1691 f470;

    /* JADX INFO: renamed from: ޱ, reason: contains not printable characters */
    public C1601 f471;

    /* JADX INFO: renamed from: ࢠ, reason: contains not printable characters */
    public C0069 f472;

    /* JADX INFO: renamed from: ࢢ, reason: contains not printable characters */
    public boolean f473;

    /* JADX INFO: renamed from: ࢣ, reason: contains not printable characters */
    public final Runnable f474;

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$֏, reason: contains not printable characters */
    public class C0066 implements ActionMenuView.InterfaceC0045 {
        public C0066() {
        }
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ؠ, reason: contains not printable characters */
    public class RunnableC0067 implements Runnable {
        public RunnableC0067() {
        }

        @Override // java.lang.Runnable
        public void run() {
            Toolbar.this.m198();
        }
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ހ, reason: contains not printable characters */
    public class ViewOnClickListenerC0068 implements View.OnClickListener {
        public ViewOnClickListenerC0068() {
        }

        @Override // android.view.View.OnClickListener
        public void onClick(View view) {
            C0069 c0069 = Toolbar.this.f472;
            C1576 c1576 = c0069 == null ? null : c0069.f479;
            if (c1576 != null) {
                c1576.collapseActionView();
            }
        }
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ށ, reason: contains not printable characters */
    public class C0069 implements InterfaceC1587 {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public C1572 f478;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public C1576 f479;

        public C0069() {
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo199(Context context, C1572 c1572) {
            C1576 c1576;
            C1572 c15722 = this.f478;
            if (c15722 != null && (c1576 = this.f479) != null) {
                c15722.mo3097(c1576);
            }
            this.f478 = c1572;
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo200(C1572 c1572, boolean z) {
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo201(InterfaceC1587.InterfaceC1588 interfaceC1588) {
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo202(boolean z) {
            if (this.f479 != null) {
                C1572 c1572 = this.f478;
                boolean z2 = false;
                if (c1572 != null) {
                    int size = c1572.size();
                    int i = 0;
                    while (true) {
                        if (i >= size) {
                            break;
                        }
                        if (this.f478.getItem(i) == this.f479) {
                            z2 = true;
                            break;
                        }
                        i++;
                    }
                }
                if (z2) {
                    return;
                }
                mo203(this.f478, this.f479);
            }
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public boolean mo203(C1572 c1572, C1576 c1576) {
            KeyEvent.Callback callback = Toolbar.this.f444;
            if (callback instanceof InterfaceC1549) {
                ((InterfaceC1549) callback).mo156();
            }
            Toolbar toolbar = Toolbar.this;
            toolbar.removeView(toolbar.f444);
            Toolbar toolbar2 = Toolbar.this;
            toolbar2.removeView(toolbar2.f443);
            Toolbar toolbar3 = Toolbar.this;
            toolbar3.f444 = null;
            int size = toolbar3.f466.size();
            while (true) {
                size--;
                if (size < 0) {
                    toolbar3.f466.clear();
                    this.f479 = null;
                    Toolbar.this.requestLayout();
                    c1576.f5133 = false;
                    c1576.f5118.m3100(false);
                    return true;
                }
                toolbar3.addView(toolbar3.f466.get(size));
            }
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public boolean mo204(SubMenuC1596 subMenuC1596) {
            return false;
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public boolean mo205() {
            return false;
        }

        @Override // p037.p041.p049.p050.InterfaceC1587
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public boolean mo206(C1572 c1572, C1576 c1576) {
            Toolbar.this.m185();
            ViewParent parent = Toolbar.this.f443.getParent();
            Toolbar toolbar = Toolbar.this;
            if (parent != toolbar) {
                if (parent instanceof ViewGroup) {
                    ((ViewGroup) parent).removeView(toolbar.f443);
                }
                Toolbar toolbar2 = Toolbar.this;
                toolbar2.addView(toolbar2.f443);
            }
            Toolbar.this.f444 = c1576.getActionView();
            this.f479 = c1576;
            ViewParent parent2 = Toolbar.this.f444.getParent();
            Toolbar toolbar3 = Toolbar.this;
            if (parent2 != toolbar3) {
                if (parent2 instanceof ViewGroup) {
                    ((ViewGroup) parent2).removeView(toolbar3.f444);
                }
                C0070 c0070GenerateDefaultLayoutParams = Toolbar.this.generateDefaultLayoutParams();
                Toolbar toolbar4 = Toolbar.this;
                c0070GenerateDefaultLayoutParams.f4653 = 8388611 | (toolbar4.f449 & 112);
                c0070GenerateDefaultLayoutParams.f481 = 2;
                toolbar4.f444.setLayoutParams(c0070GenerateDefaultLayoutParams);
                Toolbar toolbar5 = Toolbar.this;
                toolbar5.addView(toolbar5.f444);
            }
            Toolbar toolbar6 = Toolbar.this;
            int childCount = toolbar6.getChildCount();
            while (true) {
                childCount--;
                if (childCount < 0) {
                    break;
                }
                View childAt = toolbar6.getChildAt(childCount);
                if (((C0070) childAt.getLayoutParams()).f481 != 2 && childAt != toolbar6.f436) {
                    toolbar6.removeViewAt(childCount);
                    toolbar6.f466.add(childAt);
                }
            }
            Toolbar.this.requestLayout();
            c1576.f5133 = true;
            c1576.f5118.m3100(false);
            KeyEvent.Callback callback = Toolbar.this.f444;
            if (callback instanceof InterfaceC1549) {
                ((InterfaceC1549) callback).mo152();
            }
            return true;
        }
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ނ, reason: contains not printable characters */
    public static class C0070 extends AbstractC1478.C1479 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public int f481;

        public C0070(int i, int i2) {
            super(i, i2);
            this.f481 = 0;
            this.f4653 = 8388627;
        }

        public C0070(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
            this.f481 = 0;
        }

        public C0070(ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
            this.f481 = 0;
        }

        public C0070(ViewGroup.MarginLayoutParams marginLayoutParams) {
            super(marginLayoutParams);
            this.f481 = 0;
            ((ViewGroup.MarginLayoutParams) this).leftMargin = marginLayoutParams.leftMargin;
            ((ViewGroup.MarginLayoutParams) this).topMargin = marginLayoutParams.topMargin;
            ((ViewGroup.MarginLayoutParams) this).rightMargin = marginLayoutParams.rightMargin;
            ((ViewGroup.MarginLayoutParams) this).bottomMargin = marginLayoutParams.bottomMargin;
        }

        public C0070(C0070 c0070) {
            super((AbstractC1478.C1479) c0070);
            this.f481 = 0;
            this.f481 = c0070.f481;
        }

        public C0070(AbstractC1478.C1479 c1479) {
            super(c1479);
            this.f481 = 0;
        }
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ރ, reason: contains not printable characters */
    public interface InterfaceC0071 {
        boolean onMenuItemClick(MenuItem menuItem);
    }

    /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ބ, reason: contains not printable characters */
    public static class C0072 extends AbstractC1974 {
        public static final Parcelable.Creator<C0072> CREATOR = new C0073();

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public int f482;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public boolean f483;

        /* JADX INFO: renamed from: androidx.appcompat.widget.Toolbar$ބ$֏, reason: contains not printable characters */
        public class C0073 implements Parcelable.ClassLoaderCreator<C0072> {
            @Override // android.os.Parcelable.Creator
            public Object createFromParcel(Parcel parcel) {
                return new C0072(parcel, null);
            }

            @Override // android.os.Parcelable.ClassLoaderCreator
            public C0072 createFromParcel(Parcel parcel, ClassLoader classLoader) {
                return new C0072(parcel, classLoader);
            }

            @Override // android.os.Parcelable.Creator
            public Object[] newArray(int i) {
                return new C0072[i];
            }
        }

        public C0072(Parcel parcel, ClassLoader classLoader) {
            super(parcel, classLoader);
            this.f482 = parcel.readInt();
            this.f483 = parcel.readInt() != 0;
        }

        public C0072(Parcelable parcelable) {
            super(parcelable);
        }

        @Override // p037.p083.p084.AbstractC1974, android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeParcelable(this.f6473, i);
            parcel.writeInt(this.f482);
            parcel.writeInt(this.f483 ? 1 : 0);
        }
    }

    public Toolbar(Context context) {
        this(context, null);
    }

    public Toolbar(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, C1468.toolbarStyle);
    }

    public Toolbar(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f458 = 8388627;
        this.f465 = new ArrayList<>();
        this.f466 = new ArrayList<>();
        this.f467 = new int[2];
        this.f469 = new C0066();
        this.f474 = new RunnableC0067();
        C1689 c1689M3294 = C1689.m3294(getContext(), attributeSet, C1477.Toolbar, i, 0);
        C1920.m3742(this, context, C1477.Toolbar, attributeSet, c1689M3294.f5496, i, 0);
        this.f447 = c1689M3294.m3305(C1477.Toolbar_titleTextAppearance, 0);
        this.f448 = c1689M3294.m3305(C1477.Toolbar_subtitleTextAppearance, 0);
        this.f458 = c1689M3294.f5496.getInteger(C1477.Toolbar_android_gravity, this.f458);
        this.f449 = c1689M3294.f5496.getInteger(C1477.Toolbar_buttonGravity, 48);
        int iM3295 = c1689M3294.m3295(C1477.Toolbar_titleMargin, 0);
        iM3295 = c1689M3294.m3307(C1477.Toolbar_titleMargins) ? c1689M3294.m3295(C1477.Toolbar_titleMargins, iM3295) : iM3295;
        this.f454 = iM3295;
        this.f453 = iM3295;
        this.f452 = iM3295;
        this.f451 = iM3295;
        int iM32952 = c1689M3294.m3295(C1477.Toolbar_titleMarginStart, -1);
        if (iM32952 >= 0) {
            this.f451 = iM32952;
        }
        int iM32953 = c1689M3294.m3295(C1477.Toolbar_titleMarginEnd, -1);
        if (iM32953 >= 0) {
            this.f452 = iM32953;
        }
        int iM32954 = c1689M3294.m3295(C1477.Toolbar_titleMarginTop, -1);
        if (iM32954 >= 0) {
            this.f453 = iM32954;
        }
        int iM32955 = c1689M3294.m3295(C1477.Toolbar_titleMarginBottom, -1);
        if (iM32955 >= 0) {
            this.f454 = iM32955;
        }
        this.f450 = c1689M3294.m3299(C1477.Toolbar_maxButtonHeight, -1);
        int iM32956 = c1689M3294.m3295(C1477.Toolbar_contentInsetStart, Integer.MIN_VALUE);
        int iM32957 = c1689M3294.m3295(C1477.Toolbar_contentInsetEnd, Integer.MIN_VALUE);
        int iM3299 = c1689M3294.m3299(C1477.Toolbar_contentInsetLeft, 0);
        int iM32992 = c1689M3294.m3299(C1477.Toolbar_contentInsetRight, 0);
        m191();
        C1679 c1679 = this.f455;
        c1679.f5455 = false;
        if (iM3299 != Integer.MIN_VALUE) {
            c1679.f5452 = iM3299;
            c1679.f5448 = iM3299;
        }
        if (iM32992 != Integer.MIN_VALUE) {
            c1679.f5453 = iM32992;
            c1679.f5449 = iM32992;
        }
        if (iM32956 != Integer.MIN_VALUE || iM32957 != Integer.MIN_VALUE) {
            this.f455.m3277(iM32956, iM32957);
        }
        this.f456 = c1689M3294.m3295(C1477.Toolbar_contentInsetStartWithNavigation, Integer.MIN_VALUE);
        this.f457 = c1689M3294.m3295(C1477.Toolbar_contentInsetEndWithActions, Integer.MIN_VALUE);
        this.f441 = c1689M3294.m3300(C1477.Toolbar_collapseIcon);
        this.f442 = c1689M3294.m3306(C1477.Toolbar_collapseContentDescription);
        CharSequence charSequenceM3306 = c1689M3294.m3306(C1477.Toolbar_title);
        if (!TextUtils.isEmpty(charSequenceM3306)) {
            setTitle(charSequenceM3306);
        }
        CharSequence charSequenceM33062 = c1689M3294.m3306(C1477.Toolbar_subtitle);
        if (!TextUtils.isEmpty(charSequenceM33062)) {
            setSubtitle(charSequenceM33062);
        }
        this.f445 = getContext();
        setPopupTheme(c1689M3294.m3305(C1477.Toolbar_popupTheme, 0));
        Drawable drawableM3300 = c1689M3294.m3300(C1477.Toolbar_navigationIcon);
        if (drawableM3300 != null) {
            setNavigationIcon(drawableM3300);
        }
        CharSequence charSequenceM33063 = c1689M3294.m3306(C1477.Toolbar_navigationContentDescription);
        if (!TextUtils.isEmpty(charSequenceM33063)) {
            setNavigationContentDescription(charSequenceM33063);
        }
        Drawable drawableM33002 = c1689M3294.m3300(C1477.Toolbar_logo);
        if (drawableM33002 != null) {
            setLogo(drawableM33002);
        }
        CharSequence charSequenceM33064 = c1689M3294.m3306(C1477.Toolbar_logoDescription);
        if (!TextUtils.isEmpty(charSequenceM33064)) {
            setLogoDescription(charSequenceM33064);
        }
        if (c1689M3294.m3307(C1477.Toolbar_titleTextColor)) {
            setTitleTextColor(c1689M3294.m3296(C1477.Toolbar_titleTextColor));
        }
        if (c1689M3294.m3307(C1477.Toolbar_subtitleTextColor)) {
            setSubtitleTextColor(c1689M3294.m3296(C1477.Toolbar_subtitleTextColor));
        }
        if (c1689M3294.m3307(C1477.Toolbar_menu)) {
            getMenuInflater().inflate(c1689M3294.m3305(C1477.Toolbar_menu, 0), getMenu());
        }
        c1689M3294.f5496.recycle();
    }

    private MenuInflater getMenuInflater() {
        return new C1554(getContext());
    }

    @Override // android.view.ViewGroup
    public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return super.checkLayoutParams(layoutParams) && (layoutParams instanceof C0070);
    }

    @Override // android.view.ViewGroup
    public C0070 generateDefaultLayoutParams() {
        return new C0070(-2, -2);
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        return new C0070(getContext(), attributeSet);
    }

    @Override // android.view.ViewGroup
    public C0070 generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof C0070 ? new C0070((C0070) layoutParams) : layoutParams instanceof AbstractC1478.C1479 ? new C0070((AbstractC1478.C1479) layoutParams) : layoutParams instanceof ViewGroup.MarginLayoutParams ? new C0070((ViewGroup.MarginLayoutParams) layoutParams) : new C0070(layoutParams);
    }

    public CharSequence getCollapseContentDescription() {
        ImageButton imageButton = this.f443;
        if (imageButton != null) {
            return imageButton.getContentDescription();
        }
        return null;
    }

    public Drawable getCollapseIcon() {
        ImageButton imageButton = this.f443;
        if (imageButton != null) {
            return imageButton.getDrawable();
        }
        return null;
    }

    public int getContentInsetEnd() {
        C1679 c1679 = this.f455;
        if (c1679 != null) {
            return c1679.f5454 ? c1679.f5448 : c1679.f5449;
        }
        return 0;
    }

    public int getContentInsetEndWithActions() {
        int i = this.f457;
        return i != Integer.MIN_VALUE ? i : getContentInsetEnd();
    }

    public int getContentInsetLeft() {
        C1679 c1679 = this.f455;
        if (c1679 != null) {
            return c1679.f5448;
        }
        return 0;
    }

    public int getContentInsetRight() {
        C1679 c1679 = this.f455;
        if (c1679 != null) {
            return c1679.f5449;
        }
        return 0;
    }

    public int getContentInsetStart() {
        C1679 c1679 = this.f455;
        if (c1679 != null) {
            return c1679.f5454 ? c1679.f5449 : c1679.f5448;
        }
        return 0;
    }

    public int getContentInsetStartWithNavigation() {
        int i = this.f456;
        return i != Integer.MIN_VALUE ? i : getContentInsetStart();
    }

    public int getCurrentContentInsetEnd() {
        C1572 c1572;
        ActionMenuView actionMenuView = this.f436;
        return actionMenuView != null && (c1572 = actionMenuView.f284) != null && c1572.hasVisibleItems() ? Math.max(getContentInsetEnd(), Math.max(this.f457, 0)) : getContentInsetEnd();
    }

    public int getCurrentContentInsetLeft() {
        return C1920.m3760(this) == 1 ? getCurrentContentInsetEnd() : getCurrentContentInsetStart();
    }

    public int getCurrentContentInsetRight() {
        return C1920.m3760(this) == 1 ? getCurrentContentInsetStart() : getCurrentContentInsetEnd();
    }

    public int getCurrentContentInsetStart() {
        return getNavigationIcon() != null ? Math.max(getContentInsetStart(), Math.max(this.f456, 0)) : getContentInsetStart();
    }

    public Drawable getLogo() {
        ImageView imageView = this.f440;
        if (imageView != null) {
            return imageView.getDrawable();
        }
        return null;
    }

    public CharSequence getLogoDescription() {
        ImageView imageView = this.f440;
        if (imageView != null) {
            return imageView.getContentDescription();
        }
        return null;
    }

    public Menu getMenu() {
        m192();
        return this.f436.getMenu();
    }

    public CharSequence getNavigationContentDescription() {
        ImageButton imageButton = this.f439;
        if (imageButton != null) {
            return imageButton.getContentDescription();
        }
        return null;
    }

    public Drawable getNavigationIcon() {
        ImageButton imageButton = this.f439;
        if (imageButton != null) {
            return imageButton.getDrawable();
        }
        return null;
    }

    public C1601 getOuterActionMenuPresenter() {
        return this.f471;
    }

    public Drawable getOverflowIcon() {
        m192();
        return this.f436.getOverflowIcon();
    }

    public Context getPopupContext() {
        return this.f445;
    }

    public int getPopupTheme() {
        return this.f446;
    }

    public CharSequence getSubtitle() {
        return this.f460;
    }

    public final TextView getSubtitleTextView() {
        return this.f438;
    }

    public CharSequence getTitle() {
        return this.f459;
    }

    public int getTitleMarginBottom() {
        return this.f454;
    }

    public int getTitleMarginEnd() {
        return this.f452;
    }

    public int getTitleMarginStart() {
        return this.f451;
    }

    public int getTitleMarginTop() {
        return this.f453;
    }

    public final TextView getTitleTextView() {
        return this.f437;
    }

    public InterfaceC1649 getWrapper() {
        if (this.f470 == null) {
            this.f470 = new C1691(this, true);
        }
        return this.f470;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        removeCallbacks(this.f474);
    }

    @Override // android.view.View
    public boolean onHoverEvent(MotionEvent motionEvent) {
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 9) {
            this.f464 = false;
        }
        if (!this.f464) {
            boolean zOnHoverEvent = super.onHoverEvent(motionEvent);
            if (actionMasked == 9 && !zOnHoverEvent) {
                this.f464 = true;
            }
        }
        if (actionMasked == 10 || actionMasked == 3) {
            this.f464 = false;
        }
        return true;
    }

    /* JADX WARN: Removed duplicated region for block: B:105:0x029f A[LOOP:0: B:104:0x029d->B:105:0x029f, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:108:0x02c1 A[LOOP:1: B:107:0x02bf->B:108:0x02c1, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:111:0x02e6 A[LOOP:2: B:110:0x02e4->B:111:0x02e6, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:115:0x0327  */
    /* JADX WARN: Removed duplicated region for block: B:120:0x0338 A[LOOP:3: B:119:0x0336->B:120:0x0338, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:19:0x005f  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x0076  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x00b3  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x00ca  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00e7  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0100  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x0105  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x011d  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x012a  */
    /* JADX WARN: Removed duplicated region for block: B:49:0x012c  */
    /* JADX WARN: Removed duplicated region for block: B:50:0x012f  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x0133  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0136  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0167  */
    /* JADX WARN: Removed duplicated region for block: B:75:0x01a5  */
    /* JADX WARN: Removed duplicated region for block: B:77:0x01b6  */
    /* JADX WARN: Removed duplicated region for block: B:90:0x0225  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        int iM184;
        int iM190;
        boolean zM195;
        boolean zM1952;
        int i5;
        int measuredHeight;
        int i6;
        int i7;
        int i8;
        int i9;
        int i10;
        int paddingTop;
        int i11;
        int i12;
        int i13;
        int i14;
        int size;
        int iM1842;
        int i15;
        int size2;
        int i16;
        int size3;
        int i17;
        int i18;
        int size4;
        int i19;
        boolean z2 = C1920.m3760(this) == 1;
        int width = getWidth();
        int height = getHeight();
        int paddingLeft = getPaddingLeft();
        int paddingRight = getPaddingRight();
        int paddingTop2 = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        int i20 = width - paddingRight;
        int[] iArr = this.f467;
        iArr[1] = 0;
        iArr[0] = 0;
        int minimumHeight = getMinimumHeight();
        int iMin = minimumHeight >= 0 ? Math.min(minimumHeight, i4 - i2) : 0;
        if (!m195(this.f439)) {
            iM184 = paddingLeft;
        } else {
            if (z2) {
                iM190 = m190(this.f439, i20, iArr, iMin);
                iM184 = paddingLeft;
                if (m195(this.f443)) {
                    if (z2) {
                        iM190 = m190(this.f443, iM190, iArr, iMin);
                    } else {
                        iM184 = m184(this.f443, iM184, iArr, iMin);
                    }
                }
                if (m195(this.f436)) {
                    if (z2) {
                        iM184 = m184(this.f436, iM184, iArr, iMin);
                    } else {
                        iM190 = m190(this.f436, iM190, iArr, iMin);
                    }
                }
                int currentContentInsetLeft = getCurrentContentInsetLeft();
                int currentContentInsetRight = getCurrentContentInsetRight();
                iArr[0] = Math.max(0, currentContentInsetLeft - iM184);
                iArr[1] = Math.max(0, currentContentInsetRight - (i20 - iM190));
                int iMax = Math.max(iM184, currentContentInsetLeft);
                int iMin2 = Math.min(iM190, i20 - currentContentInsetRight);
                if (m195(this.f444)) {
                    if (z2) {
                        iMin2 = m190(this.f444, iMin2, iArr, iMin);
                    } else {
                        iMax = m184(this.f444, iMax, iArr, iMin);
                    }
                }
                if (m195(this.f440)) {
                    if (z2) {
                        iMin2 = m190(this.f440, iMin2, iArr, iMin);
                    } else {
                        iMax = m184(this.f440, iMax, iArr, iMin);
                    }
                }
                zM195 = m195(this.f437);
                zM1952 = m195(this.f438);
                if (zM195) {
                    i5 = paddingRight;
                    measuredHeight = 0;
                } else {
                    C0070 c0070 = (C0070) this.f437.getLayoutParams();
                    i5 = paddingRight;
                    measuredHeight = this.f437.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) c0070).topMargin + ((ViewGroup.MarginLayoutParams) c0070).bottomMargin + 0;
                }
                if (zM1952) {
                    i6 = width;
                } else {
                    C0070 c00702 = (C0070) this.f438.getLayoutParams();
                    i6 = width;
                    measuredHeight += this.f438.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) c00702).topMargin + ((ViewGroup.MarginLayoutParams) c00702).bottomMargin;
                }
                if (!zM195 || zM1952) {
                    TextView textView = !zM195 ? this.f437 : this.f438;
                    TextView textView2 = !zM1952 ? this.f438 : this.f437;
                    C0070 c00703 = (C0070) textView.getLayoutParams();
                    C0070 c00704 = (C0070) textView2.getLayoutParams();
                    boolean z3 = (zM195 && this.f437.getMeasuredWidth() > 0) || (zM1952 && this.f438.getMeasuredWidth() > 0);
                    i7 = this.f458 & 112;
                    i8 = paddingLeft;
                    if (i7 == 48) {
                        i9 = iMax;
                        i10 = iMin;
                        paddingTop = getPaddingTop() + ((ViewGroup.MarginLayoutParams) c00703).topMargin + this.f453;
                    } else if (i7 != 80) {
                        int iMax2 = (((height - paddingTop2) - paddingBottom) - measuredHeight) / 2;
                        int i21 = ((ViewGroup.MarginLayoutParams) c00703).topMargin;
                        i10 = iMin;
                        int i22 = this.f453;
                        i9 = iMax;
                        if (iMax2 < i21 + i22) {
                            iMax2 = i21 + i22;
                        } else {
                            int i23 = (((height - paddingBottom) - measuredHeight) - iMax2) - paddingTop2;
                            int i24 = ((ViewGroup.MarginLayoutParams) c00703).bottomMargin;
                            int i25 = this.f454;
                            if (i23 < i24 + i25) {
                                iMax2 = Math.max(0, iMax2 - ((((ViewGroup.MarginLayoutParams) c00704).bottomMargin + i25) - i23));
                            }
                        }
                        paddingTop = paddingTop2 + iMax2;
                    } else {
                        i9 = iMax;
                        i10 = iMin;
                        paddingTop = (((height - paddingBottom) - ((ViewGroup.MarginLayoutParams) c00704).bottomMargin) - this.f454) - measuredHeight;
                    }
                    if (z2) {
                        int i26 = (z3 ? this.f451 : 0) - iArr[1];
                        iMin2 -= Math.max(0, i26);
                        iArr[1] = Math.max(0, -i26);
                        if (zM195) {
                            C0070 c00705 = (C0070) this.f437.getLayoutParams();
                            int measuredWidth = iMin2 - this.f437.getMeasuredWidth();
                            int measuredHeight2 = this.f437.getMeasuredHeight() + paddingTop;
                            this.f437.layout(measuredWidth, paddingTop, iMin2, measuredHeight2);
                            i13 = measuredWidth - this.f452;
                            paddingTop = measuredHeight2 + ((ViewGroup.MarginLayoutParams) c00705).bottomMargin;
                        } else {
                            i13 = iMin2;
                        }
                        if (zM1952) {
                            int i27 = paddingTop + ((ViewGroup.MarginLayoutParams) ((C0070) this.f438.getLayoutParams())).topMargin;
                            this.f438.layout(iMin2 - this.f438.getMeasuredWidth(), i27, iMin2, this.f438.getMeasuredHeight() + i27);
                            i14 = iMin2 - this.f452;
                        } else {
                            i14 = iMin2;
                        }
                        if (z3) {
                            iMin2 = Math.min(i13, i14);
                        }
                        iMax = i9;
                    } else {
                        int i28 = (z3 ? this.f451 : 0) - iArr[0];
                        int iMax3 = Math.max(0, i28) + i9;
                        iArr[0] = Math.max(0, -i28);
                        if (zM195) {
                            C0070 c00706 = (C0070) this.f437.getLayoutParams();
                            int measuredWidth2 = this.f437.getMeasuredWidth() + iMax3;
                            int measuredHeight3 = this.f437.getMeasuredHeight() + paddingTop;
                            this.f437.layout(iMax3, paddingTop, measuredWidth2, measuredHeight3);
                            i11 = measuredWidth2 + this.f452;
                            paddingTop = measuredHeight3 + ((ViewGroup.MarginLayoutParams) c00706).bottomMargin;
                        } else {
                            i11 = iMax3;
                        }
                        if (zM1952) {
                            int i29 = paddingTop + ((ViewGroup.MarginLayoutParams) ((C0070) this.f438.getLayoutParams())).topMargin;
                            int measuredWidth3 = this.f438.getMeasuredWidth() + iMax3;
                            this.f438.layout(iMax3, i29, measuredWidth3, this.f438.getMeasuredHeight() + i29);
                            i12 = measuredWidth3 + this.f452;
                        } else {
                            i12 = iMax3;
                        }
                        iMax = z3 ? Math.max(i11, i12) : iMax3;
                    }
                } else {
                    i8 = paddingLeft;
                    i10 = iMin;
                }
                m188(this.f465, 3);
                size = this.f465.size();
                iM1842 = iMax;
                for (i15 = 0; i15 < size; i15++) {
                    iM1842 = m184(this.f465.get(i15), iM1842, iArr, i10);
                }
                int i30 = i10;
                m188(this.f465, 5);
                size2 = this.f465.size();
                for (i16 = 0; i16 < size2; i16++) {
                    iMin2 = m190(this.f465.get(i16), iMin2, iArr, i30);
                }
                m188(this.f465, 1);
                ArrayList<View> arrayList = this.f465;
                int i31 = iArr[0];
                int i32 = iArr[1];
                size3 = arrayList.size();
                int i33 = i31;
                i17 = 0;
                int measuredWidth4 = 0;
                while (i17 < size3) {
                    View view = arrayList.get(i17);
                    C0070 c00707 = (C0070) view.getLayoutParams();
                    int i34 = ((ViewGroup.MarginLayoutParams) c00707).leftMargin - i33;
                    int i35 = ((ViewGroup.MarginLayoutParams) c00707).rightMargin - i32;
                    int iMax4 = Math.max(0, i34);
                    int iMax5 = Math.max(0, i35);
                    int iMax6 = Math.max(0, -i34);
                    int iMax7 = Math.max(0, -i35);
                    measuredWidth4 += view.getMeasuredWidth() + iMax4 + iMax5;
                    i17++;
                    i32 = iMax7;
                    i33 = iMax6;
                }
                i18 = ((((i6 - i8) - i5) / 2) + i8) - (measuredWidth4 / 2);
                int i36 = measuredWidth4 + i18;
                if (i18 >= iM1842) {
                    iM1842 = i36 > iMin2 ? i18 - (i36 - iMin2) : i18;
                }
                size4 = this.f465.size();
                int iM1843 = iM1842;
                for (i19 = 0; i19 < size4; i19++) {
                    iM1843 = m184(this.f465.get(i19), iM1843, iArr, i30);
                }
                this.f465.clear();
            }
            iM184 = m184(this.f439, paddingLeft, iArr, iMin);
        }
        iM190 = i20;
        if (m195(this.f443)) {
        }
        if (m195(this.f436)) {
        }
        int currentContentInsetLeft2 = getCurrentContentInsetLeft();
        int currentContentInsetRight2 = getCurrentContentInsetRight();
        iArr[0] = Math.max(0, currentContentInsetLeft2 - iM184);
        iArr[1] = Math.max(0, currentContentInsetRight2 - (i20 - iM190));
        int iMax8 = Math.max(iM184, currentContentInsetLeft2);
        int iMin22 = Math.min(iM190, i20 - currentContentInsetRight2);
        if (m195(this.f444)) {
        }
        if (m195(this.f440)) {
        }
        zM195 = m195(this.f437);
        zM1952 = m195(this.f438);
        if (zM195) {
        }
        if (zM1952) {
        }
        if (zM195) {
            if (!zM195) {
            }
            if (!zM1952) {
            }
            C0070 c007032 = (C0070) textView.getLayoutParams();
            C0070 c007042 = (C0070) textView2.getLayoutParams();
            if (zM195) {
                i7 = this.f458 & 112;
                i8 = paddingLeft;
                if (i7 == 48) {
                }
                if (z2) {
                }
            } else {
                i7 = this.f458 & 112;
                i8 = paddingLeft;
                if (i7 == 48) {
                }
                if (z2) {
                }
            }
        }
        m188(this.f465, 3);
        size = this.f465.size();
        iM1842 = iMax8;
        while (i15 < size) {
        }
        int i302 = i10;
        m188(this.f465, 5);
        size2 = this.f465.size();
        while (i16 < size2) {
        }
        m188(this.f465, 1);
        ArrayList<View> arrayList2 = this.f465;
        int i312 = iArr[0];
        int i322 = iArr[1];
        size3 = arrayList2.size();
        int i332 = i312;
        i17 = 0;
        int measuredWidth42 = 0;
        while (i17 < size3) {
        }
        i18 = ((((i6 - i8) - i5) / 2) + i8) - (measuredWidth42 / 2);
        int i362 = measuredWidth42 + i18;
        if (i18 >= iM1842) {
        }
        size4 = this.f465.size();
        int iM18432 = iM1842;
        while (i19 < size4) {
        }
        this.f465.clear();
    }

    @Override // android.view.View
    public void onMeasure(int i, int i2) {
        char c;
        char c2;
        int iM181;
        int iMax;
        int iCombineMeasuredStates;
        int iM1812;
        int iCombineMeasuredStates2;
        int iMax2;
        int iM189;
        int[] iArr = this.f467;
        boolean z = true;
        if (C1698.m3318(this)) {
            c = 1;
            c2 = 0;
        } else {
            c = 0;
            c2 = 1;
        }
        if (m195(this.f439)) {
            m186(this.f439, i, 0, i2, 0, this.f450);
            iM181 = m181(this.f439) + this.f439.getMeasuredWidth();
            iMax = Math.max(0, m189(this.f439) + this.f439.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(0, this.f439.getMeasuredState());
        } else {
            iM181 = 0;
            iMax = 0;
            iCombineMeasuredStates = 0;
        }
        if (m195(this.f443)) {
            m186(this.f443, i, 0, i2, 0, this.f450);
            iM181 = m181(this.f443) + this.f443.getMeasuredWidth();
            iMax = Math.max(iMax, m189(this.f443) + this.f443.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f443.getMeasuredState());
        }
        int currentContentInsetStart = getCurrentContentInsetStart();
        int iMax3 = Math.max(currentContentInsetStart, iM181) + 0;
        iArr[c] = Math.max(0, currentContentInsetStart - iM181);
        if (m195(this.f436)) {
            m186(this.f436, i, iMax3, i2, 0, this.f450);
            iM1812 = m181(this.f436) + this.f436.getMeasuredWidth();
            iMax = Math.max(iMax, m189(this.f436) + this.f436.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f436.getMeasuredState());
        } else {
            iM1812 = 0;
        }
        int currentContentInsetEnd = getCurrentContentInsetEnd();
        int iMax4 = Math.max(currentContentInsetEnd, iM1812) + iMax3;
        iArr[c2] = Math.max(0, currentContentInsetEnd - iM1812);
        if (m195(this.f444)) {
            iMax4 += m183(this.f444, i, iMax4, i2, 0, iArr);
            iMax = Math.max(iMax, m189(this.f444) + this.f444.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f444.getMeasuredState());
        }
        if (m195(this.f440)) {
            iMax4 += m183(this.f440, i, iMax4, i2, 0, iArr);
            iMax = Math.max(iMax, m189(this.f440) + this.f440.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f440.getMeasuredState());
        }
        int childCount = getChildCount();
        for (int i3 = 0; i3 < childCount; i3++) {
            View childAt = getChildAt(i3);
            if (((C0070) childAt.getLayoutParams()).f481 == 0 && m195(childAt)) {
                iMax4 += m183(childAt, i, iMax4, i2, 0, iArr);
                iMax = Math.max(iMax, m189(childAt) + childAt.getMeasuredHeight());
                iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, childAt.getMeasuredState());
            }
        }
        int i4 = this.f453 + this.f454;
        int i5 = this.f451 + this.f452;
        if (m195(this.f437)) {
            m183(this.f437, i, iMax4 + i5, i2, i4, iArr);
            int iM1813 = m181(this.f437) + this.f437.getMeasuredWidth();
            iM189 = m189(this.f437) + this.f437.getMeasuredHeight();
            iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates, this.f437.getMeasuredState());
            iMax2 = iM1813;
        } else {
            iCombineMeasuredStates2 = iCombineMeasuredStates;
            iMax2 = 0;
            iM189 = 0;
        }
        if (m195(this.f438)) {
            iMax2 = Math.max(iMax2, m183(this.f438, i, iMax4 + i5, i2, iM189 + i4, iArr));
            iM189 = m189(this.f438) + this.f438.getMeasuredHeight() + iM189;
            iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates2, this.f438.getMeasuredState());
        }
        int iMax5 = Math.max(iMax, iM189);
        int paddingRight = getPaddingRight() + getPaddingLeft();
        int paddingBottom = getPaddingBottom() + getPaddingTop() + iMax5;
        int iResolveSizeAndState = View.resolveSizeAndState(Math.max(paddingRight + iMax4 + iMax2, getSuggestedMinimumWidth()), i, (-16777216) & iCombineMeasuredStates2);
        int iResolveSizeAndState2 = View.resolveSizeAndState(Math.max(paddingBottom, getSuggestedMinimumHeight()), i2, iCombineMeasuredStates2 << 16);
        if (!this.f473) {
            z = false;
            break;
        }
        int childCount2 = getChildCount();
        for (int i6 = 0; i6 < childCount2; i6++) {
            View childAt2 = getChildAt(i6);
            if (m195(childAt2) && childAt2.getMeasuredWidth() > 0 && childAt2.getMeasuredHeight() > 0) {
                z = false;
                break;
            }
        }
        setMeasuredDimension(iResolveSizeAndState, z ? 0 : iResolveSizeAndState2);
    }

    @Override // android.view.View
    public void onRestoreInstanceState(Parcelable parcelable) {
        MenuItem menuItemFindItem;
        if (!(parcelable instanceof C0072)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        C0072 c0072 = (C0072) parcelable;
        super.onRestoreInstanceState(c0072.f6473);
        ActionMenuView actionMenuView = this.f436;
        C1572 c1572 = actionMenuView != null ? actionMenuView.f284 : null;
        int i = c0072.f482;
        if (i != 0 && this.f472 != null && c1572 != null && (menuItemFindItem = c1572.findItem(i)) != null) {
            menuItemFindItem.expandActionView();
        }
        if (c0072.f483) {
            removeCallbacks(this.f474);
            post(this.f474);
        }
    }

    @Override // android.view.View
    public void onRtlPropertiesChanged(int i) {
        super.onRtlPropertiesChanged(i);
        m191();
        C1679 c1679 = this.f455;
        boolean z = i == 1;
        if (z == c1679.f5454) {
            return;
        }
        c1679.f5454 = z;
        if (!c1679.f5455) {
            c1679.f5448 = c1679.f5452;
            c1679.f5449 = c1679.f5453;
            return;
        }
        if (z) {
            int i2 = c1679.f5451;
            if (i2 == Integer.MIN_VALUE) {
                i2 = c1679.f5452;
            }
            c1679.f5448 = i2;
            int i3 = c1679.f5450;
            if (i3 == Integer.MIN_VALUE) {
                i3 = c1679.f5453;
            }
            c1679.f5449 = i3;
            return;
        }
        int i4 = c1679.f5450;
        if (i4 == Integer.MIN_VALUE) {
            i4 = c1679.f5452;
        }
        c1679.f5448 = i4;
        int i5 = c1679.f5451;
        if (i5 == Integer.MIN_VALUE) {
            i5 = c1679.f5453;
        }
        c1679.f5449 = i5;
    }

    @Override // android.view.View
    public Parcelable onSaveInstanceState() {
        C1576 c1576;
        C0072 c0072 = new C0072(super.onSaveInstanceState());
        C0069 c0069 = this.f472;
        if (c0069 != null && (c1576 = c0069.f479) != null) {
            c0072.f482 = c1576.f5105;
        }
        c0072.f483 = m197();
        return c0072;
    }

    @Override // android.view.View
    public boolean onTouchEvent(MotionEvent motionEvent) {
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 0) {
            this.f463 = false;
        }
        if (!this.f463) {
            boolean zOnTouchEvent = super.onTouchEvent(motionEvent);
            if (actionMasked == 0 && !zOnTouchEvent) {
                this.f463 = true;
            }
        }
        if (actionMasked == 1 || actionMasked == 3) {
            this.f463 = false;
        }
        return true;
    }

    public void setCollapseContentDescription(int i) {
        setCollapseContentDescription(i != 0 ? getContext().getText(i) : null);
    }

    public void setCollapseContentDescription(CharSequence charSequence) {
        if (!TextUtils.isEmpty(charSequence)) {
            m185();
        }
        ImageButton imageButton = this.f443;
        if (imageButton != null) {
            imageButton.setContentDescription(charSequence);
        }
    }

    public void setCollapseIcon(int i) {
        setCollapseIcon(C1527.m3025(getContext(), i));
    }

    public void setCollapseIcon(Drawable drawable) {
        if (drawable != null) {
            m185();
            this.f443.setImageDrawable(drawable);
        } else {
            ImageButton imageButton = this.f443;
            if (imageButton != null) {
                imageButton.setImageDrawable(this.f441);
            }
        }
    }

    public void setCollapsible(boolean z) {
        this.f473 = z;
        requestLayout();
    }

    public void setContentInsetEndWithActions(int i) {
        if (i < 0) {
            i = Integer.MIN_VALUE;
        }
        if (i != this.f457) {
            this.f457 = i;
            if (getNavigationIcon() != null) {
                requestLayout();
            }
        }
    }

    public void setContentInsetStartWithNavigation(int i) {
        if (i < 0) {
            i = Integer.MIN_VALUE;
        }
        if (i != this.f456) {
            this.f456 = i;
            if (getNavigationIcon() != null) {
                requestLayout();
            }
        }
    }

    public void setLogo(int i) {
        setLogo(C1527.m3025(getContext(), i));
    }

    public void setLogo(Drawable drawable) {
        if (drawable != null) {
            if (this.f440 == null) {
                this.f440 = new AppCompatImageView(getContext());
            }
            if (!m193(this.f440)) {
                m187((View) this.f440, true);
            }
        } else {
            ImageView imageView = this.f440;
            if (imageView != null && m193(imageView)) {
                removeView(this.f440);
                this.f466.remove(this.f440);
            }
        }
        ImageView imageView2 = this.f440;
        if (imageView2 != null) {
            imageView2.setImageDrawable(drawable);
        }
    }

    public void setLogoDescription(int i) {
        setLogoDescription(getContext().getText(i));
    }

    public void setLogoDescription(CharSequence charSequence) {
        if (!TextUtils.isEmpty(charSequence) && this.f440 == null) {
            this.f440 = new AppCompatImageView(getContext());
        }
        ImageView imageView = this.f440;
        if (imageView != null) {
            imageView.setContentDescription(charSequence);
        }
    }

    public void setNavigationContentDescription(int i) {
        setNavigationContentDescription(i != 0 ? getContext().getText(i) : null);
    }

    public void setNavigationContentDescription(CharSequence charSequence) {
        if (!TextUtils.isEmpty(charSequence)) {
            m196();
        }
        ImageButton imageButton = this.f439;
        if (imageButton != null) {
            imageButton.setContentDescription(charSequence);
        }
    }

    public void setNavigationIcon(int i) {
        setNavigationIcon(C1527.m3025(getContext(), i));
    }

    public void setNavigationIcon(Drawable drawable) {
        if (drawable != null) {
            m196();
            if (!m193(this.f439)) {
                m187((View) this.f439, true);
            }
        } else {
            ImageButton imageButton = this.f439;
            if (imageButton != null && m193(imageButton)) {
                removeView(this.f439);
                this.f466.remove(this.f439);
            }
        }
        ImageButton imageButton2 = this.f439;
        if (imageButton2 != null) {
            imageButton2.setImageDrawable(drawable);
        }
    }

    public void setNavigationOnClickListener(View.OnClickListener onClickListener) {
        m196();
        this.f439.setOnClickListener(onClickListener);
    }

    public void setOnMenuItemClickListener(InterfaceC0071 interfaceC0071) {
        this.f468 = interfaceC0071;
    }

    public void setOverflowIcon(Drawable drawable) {
        m192();
        this.f436.setOverflowIcon(drawable);
    }

    public void setPopupTheme(int i) {
        if (this.f446 != i) {
            this.f446 = i;
            if (i == 0) {
                this.f445 = getContext();
            } else {
                this.f445 = new ContextThemeWrapper(getContext(), i);
            }
        }
    }

    public void setSubtitle(int i) {
        setSubtitle(getContext().getText(i));
    }

    public void setSubtitle(CharSequence charSequence) {
        if (TextUtils.isEmpty(charSequence)) {
            TextView textView = this.f438;
            if (textView != null && m193(textView)) {
                removeView(this.f438);
                this.f466.remove(this.f438);
            }
        } else {
            if (this.f438 == null) {
                Context context = getContext();
                C1642 c1642 = new C1642(context);
                this.f438 = c1642;
                c1642.setSingleLine();
                this.f438.setEllipsize(TextUtils.TruncateAt.END);
                int i = this.f448;
                if (i != 0) {
                    this.f438.setTextAppearance(context, i);
                }
                ColorStateList colorStateList = this.f462;
                if (colorStateList != null) {
                    this.f438.setTextColor(colorStateList);
                }
            }
            if (!m193(this.f438)) {
                m187((View) this.f438, true);
            }
        }
        TextView textView2 = this.f438;
        if (textView2 != null) {
            textView2.setText(charSequence);
        }
        this.f460 = charSequence;
    }

    public void setSubtitleTextColor(int i) {
        setSubtitleTextColor(ColorStateList.valueOf(i));
    }

    public void setSubtitleTextColor(ColorStateList colorStateList) {
        this.f462 = colorStateList;
        TextView textView = this.f438;
        if (textView != null) {
            textView.setTextColor(colorStateList);
        }
    }

    public void setTitle(int i) {
        setTitle(getContext().getText(i));
    }

    public void setTitle(CharSequence charSequence) {
        if (TextUtils.isEmpty(charSequence)) {
            TextView textView = this.f437;
            if (textView != null && m193(textView)) {
                removeView(this.f437);
                this.f466.remove(this.f437);
            }
        } else {
            if (this.f437 == null) {
                Context context = getContext();
                C1642 c1642 = new C1642(context);
                this.f437 = c1642;
                c1642.setSingleLine();
                this.f437.setEllipsize(TextUtils.TruncateAt.END);
                int i = this.f447;
                if (i != 0) {
                    this.f437.setTextAppearance(context, i);
                }
                ColorStateList colorStateList = this.f461;
                if (colorStateList != null) {
                    this.f437.setTextColor(colorStateList);
                }
            }
            if (!m193(this.f437)) {
                m187((View) this.f437, true);
            }
        }
        TextView textView2 = this.f437;
        if (textView2 != null) {
            textView2.setText(charSequence);
        }
        this.f459 = charSequence;
    }

    public void setTitleMarginBottom(int i) {
        this.f454 = i;
        requestLayout();
    }

    public void setTitleMarginEnd(int i) {
        this.f452 = i;
        requestLayout();
    }

    public void setTitleMarginStart(int i) {
        this.f451 = i;
        requestLayout();
    }

    public void setTitleMarginTop(int i) {
        this.f453 = i;
        requestLayout();
    }

    public void setTitleTextColor(int i) {
        setTitleTextColor(ColorStateList.valueOf(i));
    }

    public void setTitleTextColor(ColorStateList colorStateList) {
        this.f461 = colorStateList;
        TextView textView = this.f437;
        if (textView != null) {
            textView.setTextColor(colorStateList);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m180(int i) {
        int iM3760 = C1920.m3760(this);
        int absoluteGravity = Gravity.getAbsoluteGravity(i, iM3760) & 7;
        return (absoluteGravity == 1 || absoluteGravity == 3 || absoluteGravity == 5) ? absoluteGravity : iM3760 == 1 ? 5 : 3;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m181(View view) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        return marginLayoutParams.getMarginStart() + marginLayoutParams.getMarginEnd();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m182(View view, int i) {
        C0070 c0070 = (C0070) view.getLayoutParams();
        int measuredHeight = view.getMeasuredHeight();
        int i2 = i > 0 ? (measuredHeight - i) / 2 : 0;
        int i3 = c0070.f4653 & 112;
        if (i3 != 16 && i3 != 48 && i3 != 80) {
            i3 = this.f458 & 112;
        }
        if (i3 == 48) {
            return getPaddingTop() - i2;
        }
        if (i3 == 80) {
            return (((getHeight() - getPaddingBottom()) - measuredHeight) - ((ViewGroup.MarginLayoutParams) c0070).bottomMargin) - i2;
        }
        int paddingTop = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        int height = getHeight();
        int iMax = (((height - paddingTop) - paddingBottom) - measuredHeight) / 2;
        int i4 = ((ViewGroup.MarginLayoutParams) c0070).topMargin;
        if (iMax < i4) {
            iMax = i4;
        } else {
            int i5 = (((height - paddingBottom) - measuredHeight) - iMax) - paddingTop;
            int i6 = ((ViewGroup.MarginLayoutParams) c0070).bottomMargin;
            if (i5 < i6) {
                iMax = Math.max(0, iMax - (i6 - i5));
            }
        }
        return paddingTop + iMax;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m183(View view, int i, int i2, int i3, int i4, int[] iArr) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        int i5 = marginLayoutParams.leftMargin - iArr[0];
        int i6 = marginLayoutParams.rightMargin - iArr[1];
        int iMax = Math.max(0, i6) + Math.max(0, i5);
        iArr[0] = Math.max(0, -i5);
        iArr[1] = Math.max(0, -i6);
        view.measure(ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft() + iMax + i2, marginLayoutParams.width), ViewGroup.getChildMeasureSpec(i3, getPaddingBottom() + getPaddingTop() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin + i4, marginLayoutParams.height));
        return view.getMeasuredWidth() + iMax;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m184(View view, int i, int[] iArr, int i2) {
        C0070 c0070 = (C0070) view.getLayoutParams();
        int i3 = ((ViewGroup.MarginLayoutParams) c0070).leftMargin - iArr[0];
        int iMax = Math.max(0, i3) + i;
        iArr[0] = Math.max(0, -i3);
        int iM182 = m182(view, i2);
        int measuredWidth = view.getMeasuredWidth();
        view.layout(iMax, iM182, iMax + measuredWidth, view.getMeasuredHeight() + iM182);
        return measuredWidth + ((ViewGroup.MarginLayoutParams) c0070).rightMargin + iMax;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m185() {
        if (this.f443 == null) {
            C1618 c1618 = new C1618(getContext(), null, C1468.toolbarNavigationButtonStyle);
            this.f443 = c1618;
            c1618.setImageDrawable(this.f441);
            this.f443.setContentDescription(this.f442);
            C0070 c0070GenerateDefaultLayoutParams = generateDefaultLayoutParams();
            c0070GenerateDefaultLayoutParams.f4653 = 8388611 | (this.f449 & 112);
            c0070GenerateDefaultLayoutParams.f481 = 2;
            this.f443.setLayoutParams(c0070GenerateDefaultLayoutParams);
            this.f443.setOnClickListener(new ViewOnClickListenerC0068());
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m186(View view, int i, int i2, int i3, int i4, int i5) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        int childMeasureSpec = ViewGroup.getChildMeasureSpec(i, getPaddingRight() + getPaddingLeft() + marginLayoutParams.leftMargin + marginLayoutParams.rightMargin + i2, marginLayoutParams.width);
        int childMeasureSpec2 = ViewGroup.getChildMeasureSpec(i3, getPaddingBottom() + getPaddingTop() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin + i4, marginLayoutParams.height);
        int mode = View.MeasureSpec.getMode(childMeasureSpec2);
        if (mode != 1073741824 && i5 >= 0) {
            if (mode != 0) {
                i5 = Math.min(View.MeasureSpec.getSize(childMeasureSpec2), i5);
            }
            childMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(i5, 1073741824);
        }
        view.measure(childMeasureSpec, childMeasureSpec2);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m187(View view, boolean z) {
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        C0070 c0070GenerateDefaultLayoutParams = layoutParams == null ? generateDefaultLayoutParams() : !checkLayoutParams(layoutParams) ? generateLayoutParams(layoutParams) : (C0070) layoutParams;
        c0070GenerateDefaultLayoutParams.f481 = 1;
        if (!z || this.f444 == null) {
            addView(view, c0070GenerateDefaultLayoutParams);
        } else {
            view.setLayoutParams(c0070GenerateDefaultLayoutParams);
            this.f466.add(view);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m188(List<View> list, int i) {
        boolean z = C1920.m3760(this) == 1;
        int childCount = getChildCount();
        int absoluteGravity = Gravity.getAbsoluteGravity(i, getLayoutDirection());
        list.clear();
        if (!z) {
            for (int i2 = 0; i2 < childCount; i2++) {
                View childAt = getChildAt(i2);
                C0070 c0070 = (C0070) childAt.getLayoutParams();
                if (c0070.f481 == 0 && m195(childAt) && m180(c0070.f4653) == absoluteGravity) {
                    list.add(childAt);
                }
            }
            return;
        }
        for (int i3 = childCount - 1; i3 >= 0; i3--) {
            View childAt2 = getChildAt(i3);
            C0070 c00702 = (C0070) childAt2.getLayoutParams();
            if (c00702.f481 == 0 && m195(childAt2) && m180(c00702.f4653) == absoluteGravity) {
                list.add(childAt2);
            }
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final int m189(View view) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        return marginLayoutParams.topMargin + marginLayoutParams.bottomMargin;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final int m190(View view, int i, int[] iArr, int i2) {
        C0070 c0070 = (C0070) view.getLayoutParams();
        int i3 = ((ViewGroup.MarginLayoutParams) c0070).rightMargin - iArr[1];
        int iMax = i - Math.max(0, i3);
        iArr[1] = Math.max(0, -i3);
        int iM182 = m182(view, i2);
        int measuredWidth = view.getMeasuredWidth();
        view.layout(iMax - measuredWidth, iM182, iMax, view.getMeasuredHeight() + iM182);
        return iMax - (measuredWidth + ((ViewGroup.MarginLayoutParams) c0070).leftMargin);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m191() {
        if (this.f455 == null) {
            this.f455 = new C1679();
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final void m192() {
        m194();
        ActionMenuView actionMenuView = this.f436;
        if (actionMenuView.f284 == null) {
            C1572 c1572 = (C1572) actionMenuView.getMenu();
            if (this.f472 == null) {
                this.f472 = new C0069();
            }
            this.f436.setExpandedActionViewsExclusive(true);
            c1572.m3092(this.f472, this.f445);
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final boolean m193(View view) {
        return view.getParent() == this || this.f466.contains(view);
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final void m194() {
        if (this.f436 == null) {
            ActionMenuView actionMenuView = new ActionMenuView(getContext());
            this.f436 = actionMenuView;
            actionMenuView.setPopupTheme(this.f446);
            this.f436.setOnMenuItemClickListener(this.f469);
            ActionMenuView actionMenuView2 = this.f436;
            actionMenuView2.f289 = null;
            actionMenuView2.f290 = null;
            C0070 c0070GenerateDefaultLayoutParams = generateDefaultLayoutParams();
            c0070GenerateDefaultLayoutParams.f4653 = 8388613 | (this.f449 & 112);
            this.f436.setLayoutParams(c0070GenerateDefaultLayoutParams);
            m187((View) this.f436, false);
        }
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final boolean m195(View view) {
        return (view == null || view.getParent() != this || view.getVisibility() == 8) ? false : true;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final void m196() {
        if (this.f439 == null) {
            this.f439 = new C1618(getContext(), null, C1468.toolbarNavigationButtonStyle);
            C0070 c0070GenerateDefaultLayoutParams = generateDefaultLayoutParams();
            c0070GenerateDefaultLayoutParams.f4653 = 8388611 | (this.f449 & 112);
            this.f439.setLayoutParams(c0070GenerateDefaultLayoutParams);
        }
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public boolean m197() {
        ActionMenuView actionMenuView = this.f436;
        if (actionMenuView != null) {
            C1601 c1601 = actionMenuView.f288;
            if (c1601 != null && c1601.m3141()) {
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public boolean m198() {
        ActionMenuView actionMenuView = this.f436;
        if (actionMenuView != null) {
            C1601 c1601 = actionMenuView.f288;
            if (c1601 != null && c1601.m3142()) {
                return true;
            }
        }
        return false;
    }
}
