package androidx.appcompat.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater;
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.widget.TextView;
import android.window.OnBackInvokedDispatcher;
import ar.tvplayer.tv.R;
import defpackage.AbstractC0430;
import defpackage.AbstractC2514;
import defpackage.AbstractC2746;
import defpackage.AbstractC3418;
import defpackage.C0291;
import defpackage.C0709;
import defpackage.C0938;
import defpackage.C1578;
import defpackage.C1761;
import defpackage.C1992;
import defpackage.C3844;
import defpackage.C4149;
import defpackage.C4314;
import defpackage.C4628;
import defpackage.C4867;
import defpackage.C5398;
import defpackage.C5535;
import defpackage.InterfaceC0366;
import defpackage.InterfaceC4782;
import defpackage.MenuC3271;
import defpackage.RunnableC1500;
import defpackage.RunnableC2896;
import defpackage.ViewOnClickListenerC1781;
import defpackage.ViewOnClickListenerC2399;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.WeakHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

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

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public int f213;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public int f214;

    /* JADX INFO: renamed from: ʿᵿʽᵞ, reason: contains not printable characters */
    public final ArrayList f215;

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public ColorStateList f216;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final int f217;

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public ColorStateList f218;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final int f219;

    /* JADX INFO: renamed from: ˁᵺˈ, reason: contains not printable characters */
    public final ᵷˇ f220;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final CharSequence f221;

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public int f222;

    /* JADX INFO: renamed from: ˉˆᵗ, reason: contains not printable characters */
    public ArrayList f223;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public int f224;

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public CharSequence f225;

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public int f226;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public int f227;

    /* JADX INFO: renamed from: ˋʿᐧ, reason: contains not printable characters */
    public final ᵣˊˈᵪ f228;

    /* JADX INFO: renamed from: ˋᵯᵩ, reason: contains not printable characters */
    public C3844 f229;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public ActionMenuView f230;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public C4149 f231;

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public final RunnableC1500 f232;

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public boolean f233;

    /* JADX INFO: renamed from: ːᵝٴᵶ, reason: contains not printable characters */
    public C1761 f234;

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public C0938 f235;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public Context f236;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public C4867 f237;

    /* JADX INFO: renamed from: ᵗᵭ, reason: contains not printable characters */
    public boolean f238;

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public boolean f239;

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public int f240;

    /* JADX INFO: renamed from: ᵜᵤ, reason: contains not printable characters */
    public C1992 f241;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public C4867 f242;

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public CharSequence f243;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public int f244;

    /* JADX INFO: renamed from: ᵡᵶ, reason: contains not printable characters */
    public final ArrayList f245;

    /* JADX INFO: renamed from: ᵡᵶᵬʤ, reason: contains not printable characters */
    public final int[] f246;

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public final int f247;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public C4149 f248;

    /* JADX INFO: renamed from: ᵫˈᵹ, reason: contains not printable characters */
    public C5535 f249;

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public boolean f250;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public AppCompatImageView f251;

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public int f252;

    /* JADX INFO: renamed from: ᵵᵸᵕᵸ, reason: contains not printable characters */
    public OnBackInvokedDispatcher f253;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final Drawable f254;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public View f255;

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

    public Toolbar(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, R.attr.h);
    }

    public Toolbar(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f247 = 8388627;
        this.f215 = new ArrayList();
        this.f245 = new ArrayList();
        this.f246 = new int[2];
        this.f228 = new ᵣˊˈᵪ(new RunnableC2896(this, 1));
        this.f223 = new ArrayList();
        this.f220 = new ᵷˇ(this);
        this.f232 = new RunnableC1500(26, this);
        Context context2 = getContext();
        int[] iArr = AbstractC0430.f2386;
        C5398 c5398M11010 = C5398.m11010(context2, attributeSet, iArr, i);
        AbstractC2746.m6646(this, context, iArr, attributeSet, (TypedArray) c5398M11010.f20483, i);
        TypedArray typedArray = (TypedArray) c5398M11010.f20483;
        this.f244 = typedArray.getResourceId(28, 0);
        this.f224 = typedArray.getResourceId(19, 0);
        this.f247 = typedArray.getInteger(0, 8388627);
        this.f219 = typedArray.getInteger(2, 48);
        int dimensionPixelOffset = typedArray.getDimensionPixelOffset(22, 0);
        dimensionPixelOffset = typedArray.hasValue(27) ? typedArray.getDimensionPixelOffset(27, dimensionPixelOffset) : dimensionPixelOffset;
        this.f252 = dimensionPixelOffset;
        this.f240 = dimensionPixelOffset;
        this.f226 = dimensionPixelOffset;
        this.f227 = dimensionPixelOffset;
        int dimensionPixelOffset2 = typedArray.getDimensionPixelOffset(25, -1);
        if (dimensionPixelOffset2 >= 0) {
            this.f227 = dimensionPixelOffset2;
        }
        int dimensionPixelOffset3 = typedArray.getDimensionPixelOffset(24, -1);
        if (dimensionPixelOffset3 >= 0) {
            this.f226 = dimensionPixelOffset3;
        }
        int dimensionPixelOffset4 = typedArray.getDimensionPixelOffset(26, -1);
        if (dimensionPixelOffset4 >= 0) {
            this.f240 = dimensionPixelOffset4;
        }
        int dimensionPixelOffset5 = typedArray.getDimensionPixelOffset(23, -1);
        if (dimensionPixelOffset5 >= 0) {
            this.f252 = dimensionPixelOffset5;
        }
        this.f217 = typedArray.getDimensionPixelSize(13, -1);
        int dimensionPixelOffset6 = typedArray.getDimensionPixelOffset(9, Integer.MIN_VALUE);
        int dimensionPixelOffset7 = typedArray.getDimensionPixelOffset(5, Integer.MIN_VALUE);
        int dimensionPixelSize = typedArray.getDimensionPixelSize(7, 0);
        int dimensionPixelSize2 = typedArray.getDimensionPixelSize(8, 0);
        m60();
        C0938 c0938 = this.f235;
        c0938.f4083 = false;
        if (dimensionPixelSize != Integer.MIN_VALUE) {
            c0938.f4085 = dimensionPixelSize;
            c0938.f4086 = dimensionPixelSize;
        }
        if (dimensionPixelSize2 != Integer.MIN_VALUE) {
            c0938.f4089 = dimensionPixelSize2;
            c0938.f4082 = dimensionPixelSize2;
        }
        if (dimensionPixelOffset6 != Integer.MIN_VALUE || dimensionPixelOffset7 != Integer.MIN_VALUE) {
            c0938.m3186(dimensionPixelOffset6, dimensionPixelOffset7);
        }
        this.f213 = typedArray.getDimensionPixelOffset(10, Integer.MIN_VALUE);
        this.f222 = typedArray.getDimensionPixelOffset(6, Integer.MIN_VALUE);
        this.f254 = c5398M11010.m11017(4);
        this.f221 = typedArray.getText(3);
        CharSequence text = typedArray.getText(21);
        if (!TextUtils.isEmpty(text)) {
            setTitle(text);
        }
        CharSequence text2 = typedArray.getText(18);
        if (!TextUtils.isEmpty(text2)) {
            setSubtitle(text2);
        }
        this.f236 = getContext();
        setPopupTheme(typedArray.getResourceId(17, 0));
        Drawable drawableM11017 = c5398M11010.m11017(16);
        if (drawableM11017 != null) {
            setNavigationIcon(drawableM11017);
        }
        CharSequence text3 = typedArray.getText(15);
        if (!TextUtils.isEmpty(text3)) {
            setNavigationContentDescription(text3);
        }
        Drawable drawableM110172 = c5398M11010.m11017(11);
        if (drawableM110172 != null) {
            setLogo(drawableM110172);
        }
        CharSequence text4 = typedArray.getText(12);
        if (!TextUtils.isEmpty(text4)) {
            setLogoDescription(text4);
        }
        if (typedArray.hasValue(29)) {
            setTitleTextColor(c5398M11010.m11016(29));
        }
        if (typedArray.hasValue(20)) {
            setSubtitleTextColor(c5398M11010.m11016(20));
        }
        if (typedArray.hasValue(14)) {
            getMenuInflater().inflate(typedArray.getResourceId(14, 0), getMenu());
        }
        c5398M11010.m11012();
    }

    private ArrayList<MenuItem> getCurrentMenuItems() {
        ArrayList<MenuItem> arrayList = new ArrayList<>();
        Menu menu = getMenu();
        for (int i = 0; i < menu.size(); i++) {
            arrayList.add(menu.getItem(i));
        }
        return arrayList;
    }

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

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public static C4314 m42() {
        C4314 c4314 = new C4314(-2, -2);
        c4314.f16414 = 0;
        c4314.f16415 = 8388627;
        return c4314;
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public static int m43(View view) {
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        return marginLayoutParams.topMargin + marginLayoutParams.bottomMargin;
    }

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

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public static C4314 m45(ViewGroup.LayoutParams layoutParams) {
        boolean z = layoutParams instanceof C4314;
        if (z) {
            C4314 c4314 = (C4314) layoutParams;
            C4314 c43142 = new C4314(c4314);
            c43142.f16414 = 0;
            c43142.f16414 = c4314.f16414;
            return c43142;
        }
        if (z) {
            C4314 c43143 = new C4314((C4314) layoutParams);
            c43143.f16414 = 0;
            return c43143;
        }
        if (!(layoutParams instanceof ViewGroup.MarginLayoutParams)) {
            C4314 c43144 = new C4314(layoutParams);
            c43144.f16414 = 0;
            return c43144;
        }
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams;
        C4314 c43145 = new C4314(marginLayoutParams);
        c43145.f16414 = 0;
        ((ViewGroup.MarginLayoutParams) c43145).leftMargin = marginLayoutParams.leftMargin;
        ((ViewGroup.MarginLayoutParams) c43145).topMargin = marginLayoutParams.topMargin;
        ((ViewGroup.MarginLayoutParams) c43145).rightMargin = marginLayoutParams.rightMargin;
        ((ViewGroup.MarginLayoutParams) c43145).bottomMargin = marginLayoutParams.bottomMargin;
        return c43145;
    }

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

    @Override // android.view.ViewGroup
    public final /* bridge */ /* synthetic */ ViewGroup.LayoutParams generateDefaultLayoutParams() {
        return m42();
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        Context context = getContext();
        C4314 c4314 = new C4314(context, attributeSet);
        c4314.f16415 = 0;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, AbstractC0430.f2377);
        c4314.f16415 = typedArrayObtainStyledAttributes.getInt(0, 0);
        typedArrayObtainStyledAttributes.recycle();
        c4314.f16414 = 0;
        return c4314;
    }

    @Override // android.view.ViewGroup
    public final /* bridge */ /* synthetic */ ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return m45(layoutParams);
    }

    public CharSequence getCollapseContentDescription() {
        C4149 c4149 = this.f231;
        if (c4149 != null) {
            return c4149.getContentDescription();
        }
        return null;
    }

    public Drawable getCollapseIcon() {
        C4149 c4149 = this.f231;
        if (c4149 != null) {
            return c4149.getDrawable();
        }
        return null;
    }

    public int getContentInsetEnd() {
        C0938 c0938 = this.f235;
        if (c0938 != null) {
            return c0938.f4087 ? c0938.f4086 : c0938.f4082;
        }
        return 0;
    }

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

    public int getContentInsetLeft() {
        C0938 c0938 = this.f235;
        if (c0938 != null) {
            return c0938.f4086;
        }
        return 0;
    }

    public int getContentInsetRight() {
        C0938 c0938 = this.f235;
        if (c0938 != null) {
            return c0938.f4082;
        }
        return 0;
    }

    public int getContentInsetStart() {
        C0938 c0938 = this.f235;
        if (c0938 != null) {
            return c0938.f4087 ? c0938.f4082 : c0938.f4086;
        }
        return 0;
    }

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

    public int getCurrentContentInsetEnd() {
        MenuC3271 menuC3271;
        ActionMenuView actionMenuView = this.f230;
        return (actionMenuView == null || (menuC3271 = actionMenuView.f145) == null || !menuC3271.hasVisibleItems()) ? getContentInsetEnd() : Math.max(getContentInsetEnd(), Math.max(this.f222, 0));
    }

    public int getCurrentContentInsetLeft() {
        return getLayoutDirection() == 1 ? getCurrentContentInsetEnd() : getCurrentContentInsetStart();
    }

    public int getCurrentContentInsetRight() {
        return getLayoutDirection() == 1 ? getCurrentContentInsetStart() : getCurrentContentInsetEnd();
    }

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

    public Drawable getLogo() {
        AppCompatImageView appCompatImageView = this.f251;
        if (appCompatImageView != null) {
            return appCompatImageView.getDrawable();
        }
        return null;
    }

    public CharSequence getLogoDescription() {
        AppCompatImageView appCompatImageView = this.f251;
        if (appCompatImageView != null) {
            return appCompatImageView.getContentDescription();
        }
        return null;
    }

    public Menu getMenu() {
        m54();
        return this.f230.getMenu();
    }

    public View getNavButtonView() {
        return this.f248;
    }

    public CharSequence getNavigationContentDescription() {
        C4149 c4149 = this.f248;
        if (c4149 != null) {
            return c4149.getContentDescription();
        }
        return null;
    }

    public Drawable getNavigationIcon() {
        C4149 c4149 = this.f248;
        if (c4149 != null) {
            return c4149.getDrawable();
        }
        return null;
    }

    public C1992 getOuterActionMenuPresenter() {
        return this.f241;
    }

    public Drawable getOverflowIcon() {
        m54();
        return this.f230.getOverflowIcon();
    }

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

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

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

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

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

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

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

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

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

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

    public InterfaceC4782 getWrapper() {
        Drawable drawable;
        if (this.f229 == null) {
            C3844 c3844 = new C3844();
            c3844.f14663 = 0;
            c3844.f14670 = this;
            c3844.f14662 = getTitle();
            c3844.f14674 = getSubtitle();
            c3844.f14671 = c3844.f14662 != null;
            c3844.f14675 = getNavigationIcon();
            C5398 c5398M11010 = C5398.m11010(getContext(), null, AbstractC0430.f2397, R.attr.h);
            TypedArray typedArray = (TypedArray) c5398M11010.f20483;
            c3844.f14667 = c5398M11010.m11017(15);
            CharSequence text = typedArray.getText(27);
            if (!TextUtils.isEmpty(text)) {
                c3844.f14671 = true;
                c3844.f14662 = text;
                if ((c3844.f14661 & 8) != 0) {
                    setTitle(text);
                    if (c3844.f14671) {
                        AbstractC2746.m6645(getRootView(), text);
                    }
                }
            }
            CharSequence text2 = typedArray.getText(25);
            if (!TextUtils.isEmpty(text2)) {
                c3844.f14674 = text2;
                if ((c3844.f14661 & 8) != 0) {
                    setSubtitle(text2);
                }
            }
            Drawable drawableM11017 = c5398M11010.m11017(20);
            if (drawableM11017 != null) {
                c3844.f14666 = drawableM11017;
                c3844.m8551();
            }
            Drawable drawableM110172 = c5398M11010.m11017(17);
            if (drawableM110172 != null) {
                c3844.f14673 = drawableM110172;
                c3844.m8551();
            }
            if (c3844.f14675 == null && (drawable = c3844.f14667) != null) {
                c3844.f14675 = drawable;
                if ((c3844.f14661 & 4) != 0) {
                    setNavigationIcon(drawable);
                } else {
                    setNavigationIcon((Drawable) null);
                }
            }
            c3844.m8552(typedArray.getInt(10, 0));
            int resourceId = typedArray.getResourceId(9, 0);
            if (resourceId != 0) {
                View viewInflate = LayoutInflater.from(getContext()).inflate(resourceId, (ViewGroup) this, false);
                View view = c3844.f14664;
                if (view != null && (c3844.f14661 & 16) != 0) {
                    removeView(view);
                }
                c3844.f14664 = viewInflate;
                if (viewInflate != null && (c3844.f14661 & 16) != 0) {
                    addView(viewInflate);
                }
                c3844.m8552(c3844.f14661 | 16);
            }
            int layoutDimension = typedArray.getLayoutDimension(13, 0);
            if (layoutDimension > 0) {
                ViewGroup.LayoutParams layoutParams = getLayoutParams();
                layoutParams.height = layoutDimension;
                setLayoutParams(layoutParams);
            }
            int dimensionPixelOffset = typedArray.getDimensionPixelOffset(7, -1);
            int dimensionPixelOffset2 = typedArray.getDimensionPixelOffset(3, -1);
            if (dimensionPixelOffset >= 0 || dimensionPixelOffset2 >= 0) {
                int iMax = Math.max(dimensionPixelOffset, 0);
                int iMax2 = Math.max(dimensionPixelOffset2, 0);
                m60();
                this.f235.m3186(iMax, iMax2);
            }
            int resourceId2 = typedArray.getResourceId(28, 0);
            if (resourceId2 != 0) {
                Context context = getContext();
                this.f244 = resourceId2;
                C4867 c4867 = this.f242;
                if (c4867 != null) {
                    c4867.setTextAppearance(context, resourceId2);
                }
            }
            int resourceId3 = typedArray.getResourceId(26, 0);
            if (resourceId3 != 0) {
                Context context2 = getContext();
                this.f224 = resourceId3;
                C4867 c48672 = this.f237;
                if (c48672 != null) {
                    c48672.setTextAppearance(context2, resourceId3);
                }
            }
            int resourceId4 = typedArray.getResourceId(22, 0);
            if (resourceId4 != 0) {
                setPopupTheme(resourceId4);
            }
            c5398M11010.m11012();
            if (R.string.h != c3844.f14663) {
                c3844.f14663 = R.string.h;
                if (TextUtils.isEmpty(getNavigationContentDescription())) {
                    int i = c3844.f14663;
                    c3844.f14669 = i != 0 ? getContext().getString(i) : null;
                    c3844.m8550();
                }
            }
            c3844.f14669 = getNavigationContentDescription();
            setNavigationOnClickListener(new ViewOnClickListenerC2399(c3844));
            this.f229 = c3844;
        }
        return this.f229;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        m50();
    }

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

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

    /* JADX WARN: Removed duplicated region for block: B:108:0x0285 A[LOOP:0: B:107:0x0283->B:108:0x0285, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:111:0x029d A[LOOP:1: B:110:0x029b->B:111:0x029d, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:114:0x02bd A[LOOP:2: B:113:0x02bb->B:114:0x02bd, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:118:0x0303  */
    /* JADX WARN: Removed duplicated region for block: B:123:0x0310 A[LOOP:3: B:122:0x030e->B:123:0x0310, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0060  */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0075  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00c5  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x00e0  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x00f7  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x00fc  */
    /* JADX WARN: Removed duplicated region for block: B:48:0x0115  */
    /* JADX WARN: Removed duplicated region for block: B:51:0x011b  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x011d  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0120  */
    /* JADX WARN: Removed duplicated region for block: B:55:0x0124  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0127  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x015a  */
    /* JADX WARN: Removed duplicated region for block: B:78:0x0193  */
    /* JADX WARN: Removed duplicated region for block: B:80:0x01a0  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x020e  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void onLayout(boolean z, int i, int i2, int i3, int i4) {
        int iM55;
        int iM53;
        int iMax;
        boolean zM47;
        boolean zM472;
        boolean z2;
        int measuredHeight;
        int i5;
        int paddingTop;
        int i6;
        int i7;
        int i8;
        int i9;
        int size;
        int iM552;
        int i10;
        int size2;
        int i11;
        int size3;
        int i12;
        int i13;
        int i14;
        int size4;
        boolean z3 = getLayoutDirection() == 1;
        int width = getWidth();
        int height = getHeight();
        int paddingLeft = getPaddingLeft();
        int paddingRight = getPaddingRight();
        int paddingTop2 = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        int i15 = width - paddingRight;
        int[] iArr = this.f246;
        iArr[1] = 0;
        iArr[0] = 0;
        WeakHashMap weakHashMap = AbstractC2746.f10556;
        int minimumHeight = getMinimumHeight();
        int iMin = minimumHeight >= 0 ? Math.min(minimumHeight, i4 - i2) : 0;
        if (m47(this.f248)) {
            C4149 c4149 = this.f248;
            if (z3) {
                iM53 = m53(c4149, i15, iMin, iArr);
                iM55 = paddingLeft;
                if (m47(this.f231)) {
                    C4149 c41492 = this.f231;
                    if (z3) {
                        iM53 = m53(c41492, iM53, iMin, iArr);
                    } else {
                        iM55 = m55(c41492, iM55, iMin, iArr);
                    }
                }
                if (m47(this.f230)) {
                    ActionMenuView actionMenuView = this.f230;
                    if (z3) {
                        iM55 = m55(actionMenuView, iM55, iMin, iArr);
                    } else {
                        iM53 = m53(actionMenuView, iM53, iMin, iArr);
                    }
                }
                int currentContentInsetLeft = getCurrentContentInsetLeft();
                int currentContentInsetRight = getCurrentContentInsetRight();
                iArr[0] = Math.max(0, currentContentInsetLeft - iM55);
                iArr[1] = Math.max(0, currentContentInsetRight - (i15 - iM53));
                iMax = Math.max(iM55, currentContentInsetLeft);
                int iMin2 = Math.min(iM53, i15 - currentContentInsetRight);
                if (m47(this.f255)) {
                    View view = this.f255;
                    if (z3) {
                        iMin2 = m53(view, iMin2, iMin, iArr);
                    } else {
                        iMax = m55(view, iMax, iMin, iArr);
                    }
                }
                if (m47(this.f251)) {
                    AppCompatImageView appCompatImageView = this.f251;
                    if (z3) {
                        iMin2 = m53(appCompatImageView, iMin2, iMin, iArr);
                    } else {
                        iMax = m55(appCompatImageView, iMax, iMin, iArr);
                    }
                }
                zM47 = m47(this.f242);
                zM472 = m47(this.f237);
                if (zM47) {
                    z2 = z3;
                    measuredHeight = 0;
                } else {
                    C4314 c4314 = (C4314) this.f242.getLayoutParams();
                    z2 = z3;
                    measuredHeight = this.f242.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) c4314).topMargin + ((ViewGroup.MarginLayoutParams) c4314).bottomMargin;
                }
                if (!zM472) {
                    C4314 c43142 = (C4314) this.f237.getLayoutParams();
                    measuredHeight = this.f237.getMeasuredHeight() + ((ViewGroup.MarginLayoutParams) c43142).topMargin + ((ViewGroup.MarginLayoutParams) c43142).bottomMargin + measuredHeight;
                }
                if (!zM47 || zM472) {
                    C4867 c4867 = !zM47 ? this.f242 : this.f237;
                    C4867 c48672 = !zM472 ? this.f237 : this.f242;
                    C4314 c43143 = (C4314) c4867.getLayoutParams();
                    C4314 c43144 = (C4314) c48672.getLayoutParams();
                    int i16 = measuredHeight;
                    boolean z4 = (zM47 && this.f242.getMeasuredWidth() > 0) || (zM472 && this.f237.getMeasuredWidth() > 0);
                    i5 = this.f247 & 112;
                    int i17 = iMax;
                    if (i5 == 48) {
                        paddingTop = getPaddingTop() + ((ViewGroup.MarginLayoutParams) c43143).topMargin + this.f240;
                    } else if (i5 != 80) {
                        int iMax2 = (((height - paddingTop2) - paddingBottom) - i16) / 2;
                        int i18 = ((ViewGroup.MarginLayoutParams) c43143).topMargin + this.f240;
                        if (iMax2 < i18) {
                            iMax2 = i18;
                        } else {
                            int i19 = (((height - paddingBottom) - i16) - iMax2) - paddingTop2;
                            int i20 = ((ViewGroup.MarginLayoutParams) c43143).bottomMargin;
                            int i21 = this.f252;
                            if (i19 < i20 + i21) {
                                iMax2 = Math.max(0, iMax2 - ((((ViewGroup.MarginLayoutParams) c43144).bottomMargin + i21) - i19));
                            }
                        }
                        paddingTop = paddingTop2 + iMax2;
                    } else {
                        paddingTop = (((height - paddingBottom) - ((ViewGroup.MarginLayoutParams) c43144).bottomMargin) - this.f252) - i16;
                    }
                    if (z2) {
                        int i22 = (z4 ? this.f227 : 0) - iArr[1];
                        iMin2 -= Math.max(0, i22);
                        iArr[1] = Math.max(0, -i22);
                        if (zM47) {
                            C4314 c43145 = (C4314) this.f242.getLayoutParams();
                            int measuredWidth = iMin2 - this.f242.getMeasuredWidth();
                            int measuredHeight2 = this.f242.getMeasuredHeight() + paddingTop;
                            this.f242.layout(measuredWidth, paddingTop, iMin2, measuredHeight2);
                            i8 = measuredWidth - this.f226;
                            paddingTop = measuredHeight2 + ((ViewGroup.MarginLayoutParams) c43145).bottomMargin;
                        } else {
                            i8 = iMin2;
                        }
                        if (zM472) {
                            int i23 = paddingTop + ((ViewGroup.MarginLayoutParams) ((C4314) this.f237.getLayoutParams())).topMargin;
                            this.f237.layout(iMin2 - this.f237.getMeasuredWidth(), i23, iMin2, this.f237.getMeasuredHeight() + i23);
                            i9 = iMin2 - this.f226;
                        } else {
                            i9 = iMin2;
                        }
                        if (z4) {
                            iMin2 = Math.min(i8, i9);
                        }
                        iMax = i17;
                    } else {
                        int i24 = (z4 ? this.f227 : 0) - iArr[0];
                        iMax = Math.max(0, i24) + i17;
                        iArr[0] = Math.max(0, -i24);
                        if (zM47) {
                            C4314 c43146 = (C4314) this.f242.getLayoutParams();
                            int measuredWidth2 = this.f242.getMeasuredWidth() + iMax;
                            int measuredHeight3 = this.f242.getMeasuredHeight() + paddingTop;
                            this.f242.layout(iMax, paddingTop, measuredWidth2, measuredHeight3);
                            i6 = measuredWidth2 + this.f226;
                            paddingTop = measuredHeight3 + ((ViewGroup.MarginLayoutParams) c43146).bottomMargin;
                        } else {
                            i6 = iMax;
                        }
                        if (zM472) {
                            int i25 = paddingTop + ((ViewGroup.MarginLayoutParams) ((C4314) this.f237.getLayoutParams())).topMargin;
                            int measuredWidth3 = this.f237.getMeasuredWidth() + iMax;
                            this.f237.layout(iMax, i25, measuredWidth3, this.f237.getMeasuredHeight() + i25);
                            i7 = measuredWidth3 + this.f226;
                        } else {
                            i7 = iMax;
                        }
                        if (z4) {
                            iMax = Math.max(i6, i7);
                        }
                    }
                }
                ArrayList arrayList = this.f215;
                m58(3, arrayList);
                size = arrayList.size();
                iM552 = iMax;
                for (i10 = 0; i10 < size; i10++) {
                    iM552 = m55((View) arrayList.get(i10), iM552, iMin, iArr);
                }
                m58(5, arrayList);
                size2 = arrayList.size();
                for (i11 = 0; i11 < size2; i11++) {
                    iMin2 = m53((View) arrayList.get(i11), iMin2, iMin, iArr);
                }
                m58(1, arrayList);
                int i26 = iArr[0];
                int i27 = iArr[1];
                size3 = arrayList.size();
                int i28 = i26;
                i12 = 0;
                int measuredWidth4 = 0;
                while (i12 < size3) {
                    View view2 = (View) arrayList.get(i12);
                    C4314 c43147 = (C4314) view2.getLayoutParams();
                    int i29 = i27;
                    int i30 = ((ViewGroup.MarginLayoutParams) c43147).leftMargin - i28;
                    int i31 = ((ViewGroup.MarginLayoutParams) c43147).rightMargin - i29;
                    int iMax3 = Math.max(0, i30);
                    int iMax4 = Math.max(0, i31);
                    int iMax5 = Math.max(0, -i30);
                    int iMax6 = Math.max(0, -i31);
                    measuredWidth4 += view2.getMeasuredWidth() + iMax3 + iMax4;
                    i12++;
                    i28 = iMax5;
                    i27 = iMax6;
                }
                i14 = ((((width - paddingLeft) - paddingRight) / 2) + paddingLeft) - (measuredWidth4 / 2);
                int i32 = measuredWidth4 + i14;
                if (i14 >= iM552) {
                    iM552 = i32 > iMin2 ? i14 - (i32 - iMin2) : i14;
                }
                size4 = arrayList.size();
                for (i13 = 0; i13 < size4; i13++) {
                    iM552 = m55((View) arrayList.get(i13), iM552, iMin, iArr);
                }
                arrayList.clear();
            }
            iM55 = m55(c4149, paddingLeft, iMin, iArr);
        } else {
            iM55 = paddingLeft;
        }
        iM53 = i15;
        if (m47(this.f231)) {
        }
        if (m47(this.f230)) {
        }
        int currentContentInsetLeft2 = getCurrentContentInsetLeft();
        int currentContentInsetRight2 = getCurrentContentInsetRight();
        iArr[0] = Math.max(0, currentContentInsetLeft2 - iM55);
        iArr[1] = Math.max(0, currentContentInsetRight2 - (i15 - iM53));
        iMax = Math.max(iM55, currentContentInsetLeft2);
        int iMin22 = Math.min(iM53, i15 - currentContentInsetRight2);
        if (m47(this.f255)) {
        }
        if (m47(this.f251)) {
        }
        zM47 = m47(this.f242);
        zM472 = m47(this.f237);
        if (zM47) {
        }
        if (!zM472) {
        }
        if (!zM47) {
            if (!zM47) {
            }
            if (!zM472) {
            }
            C4314 c431432 = (C4314) c4867.getLayoutParams();
            C4314 c431442 = (C4314) c48672.getLayoutParams();
            int i162 = measuredHeight;
            if (zM47) {
                i5 = this.f247 & 112;
                int i172 = iMax;
                if (i5 == 48) {
                }
                if (z2) {
                }
            } else {
                i5 = this.f247 & 112;
                int i1722 = iMax;
                if (i5 == 48) {
                }
                if (z2) {
                }
            }
        }
        ArrayList arrayList2 = this.f215;
        m58(3, arrayList2);
        size = arrayList2.size();
        iM552 = iMax;
        while (i10 < size) {
        }
        m58(5, arrayList2);
        size2 = arrayList2.size();
        while (i11 < size2) {
        }
        m58(1, arrayList2);
        int i262 = iArr[0];
        int i272 = iArr[1];
        size3 = arrayList2.size();
        int i282 = i262;
        i12 = 0;
        int measuredWidth42 = 0;
        while (i12 < size3) {
        }
        i14 = ((((width - paddingLeft) - paddingRight) / 2) + paddingLeft) - (measuredWidth42 / 2);
        int i322 = measuredWidth42 + i14;
        if (i14 >= iM552) {
        }
        size4 = arrayList2.size();
        while (i13 < size4) {
        }
        arrayList2.clear();
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.view.View
    public final void onMeasure(int i, int i2) {
        char c;
        Object[] objArr;
        int iM44;
        int iMax;
        int iCombineMeasuredStates;
        int iM442;
        int i3;
        int iM43;
        int iCombineMeasuredStates2;
        int iMax2;
        boolean z = AbstractC2514.f9717;
        int i4 = 0;
        if (getLayoutDirection() == 1) {
            objArr = true;
            c = 0;
        } else {
            c = 1;
            objArr = false;
        }
        if (m47(this.f248)) {
            m48(this.f248, i, 0, i2, this.f217);
            iM44 = m44(this.f248) + this.f248.getMeasuredWidth();
            iMax = Math.max(0, m43(this.f248) + this.f248.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(0, this.f248.getMeasuredState());
        } else {
            iM44 = 0;
            iMax = 0;
            iCombineMeasuredStates = 0;
        }
        if (m47(this.f231)) {
            m48(this.f231, i, 0, i2, this.f217);
            iM44 = m44(this.f231) + this.f231.getMeasuredWidth();
            iMax = Math.max(iMax, m43(this.f231) + this.f231.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f231.getMeasuredState());
        }
        int currentContentInsetStart = getCurrentContentInsetStart();
        int iMax3 = Math.max(currentContentInsetStart, iM44);
        int iMax4 = Math.max(0, currentContentInsetStart - iM44);
        Object[] objArr2 = objArr;
        int[] iArr = this.f246;
        iArr[objArr2 == true ? 1 : 0] = iMax4;
        if (m47(this.f230)) {
            m48(this.f230, i, iMax3, i2, this.f217);
            iM442 = m44(this.f230) + this.f230.getMeasuredWidth();
            iMax = Math.max(iMax, m43(this.f230) + this.f230.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f230.getMeasuredState());
        } else {
            iM442 = 0;
        }
        int currentContentInsetEnd = getCurrentContentInsetEnd();
        int iMax5 = iMax3 + Math.max(currentContentInsetEnd, iM442);
        iArr[c] = Math.max(0, currentContentInsetEnd - iM442);
        if (m47(this.f255)) {
            iMax5 += m56(this.f255, i, iMax5, i2, 0, iArr);
            iMax = Math.max(iMax, m43(this.f255) + this.f255.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f255.getMeasuredState());
        }
        if (m47(this.f251)) {
            iMax5 += m56(this.f251, i, iMax5, i2, 0, iArr);
            iMax = Math.max(iMax, m43(this.f251) + this.f251.getMeasuredHeight());
            iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, this.f251.getMeasuredState());
        }
        int childCount = getChildCount();
        for (int i5 = 0; i5 < childCount; i5++) {
            View childAt = getChildAt(i5);
            if (((C4314) childAt.getLayoutParams()).f16414 == 0 && m47(childAt)) {
                iMax5 += m56(childAt, i, iMax5, i2, 0, iArr);
                int iMax6 = Math.max(iMax, m43(childAt) + childAt.getMeasuredHeight());
                iCombineMeasuredStates = View.combineMeasuredStates(iCombineMeasuredStates, childAt.getMeasuredState());
                iMax = iMax6;
            } else {
                iMax5 = iMax5;
            }
        }
        int i6 = iMax5;
        int i7 = this.f240 + this.f252;
        int i8 = this.f227 + this.f226;
        if (m47(this.f242)) {
            m56(this.f242, i, i6 + i8, i2, i7, iArr);
            i3 = i7;
            int iM443 = m44(this.f242) + this.f242.getMeasuredWidth();
            iM43 = m43(this.f242) + this.f242.getMeasuredHeight();
            iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates, this.f242.getMeasuredState());
            iMax2 = iM443;
        } else {
            i3 = i7;
            iM43 = 0;
            iCombineMeasuredStates2 = iCombineMeasuredStates;
            iMax2 = 0;
        }
        if (m47(this.f237)) {
            iMax2 = Math.max(iMax2, m56(this.f237, i, i6 + i8, i2, iM43 + i3, iArr));
            iM43 += m43(this.f237) + this.f237.getMeasuredHeight();
            iCombineMeasuredStates2 = View.combineMeasuredStates(iCombineMeasuredStates2, this.f237.getMeasuredState());
        }
        if (m47(this.f242) || m47(this.f237)) {
            iM43 += i3;
        }
        int iMax7 = Math.max(iMax, iM43);
        int paddingRight = getPaddingRight() + getPaddingLeft() + i6 + iMax2;
        int paddingBottom = getPaddingBottom() + getPaddingTop() + iMax7;
        int iResolveSizeAndState = View.resolveSizeAndState(Math.max(paddingRight, getSuggestedMinimumWidth()), i, (-16777216) & iCombineMeasuredStates2);
        int iResolveSizeAndState2 = View.resolveSizeAndState(Math.max(paddingBottom, getSuggestedMinimumHeight()), i2, iCombineMeasuredStates2 << 16);
        if (!this.f238) {
            i4 = iResolveSizeAndState2;
            break;
        }
        int childCount2 = getChildCount();
        for (int i9 = 0; i9 < childCount2; i9++) {
            View childAt2 = getChildAt(i9);
            if (m47(childAt2) && childAt2.getMeasuredWidth() > 0 && childAt2.getMeasuredHeight() > 0) {
                i4 = iResolveSizeAndState2;
                break;
            }
        }
        setMeasuredDimension(iResolveSizeAndState, i4);
    }

    @Override // android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        MenuItem menuItemFindItem;
        if (!(parcelable instanceof C0709)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        C0709 c0709 = (C0709) parcelable;
        super.onRestoreInstanceState(c0709.f10655);
        ActionMenuView actionMenuView = this.f230;
        MenuC3271 menuC3271 = actionMenuView != null ? actionMenuView.f145 : null;
        int i = c0709.f3242;
        if (i != 0 && this.f234 != null && menuC3271 != null && (menuItemFindItem = menuC3271.findItem(i)) != null) {
            menuItemFindItem.expandActionView();
        }
        if (c0709.f3243) {
            RunnableC1500 runnableC1500 = this.f232;
            removeCallbacks(runnableC1500);
            post(runnableC1500);
        }
    }

    @Override // android.view.View
    public final void onRtlPropertiesChanged(int i) {
        super.onRtlPropertiesChanged(i);
        m60();
        C0938 c0938 = this.f235;
        boolean z = i == 1;
        if (z == c0938.f4087) {
            return;
        }
        c0938.f4087 = z;
        if (!c0938.f4083) {
            c0938.f4086 = c0938.f4085;
            c0938.f4082 = c0938.f4089;
            return;
        }
        if (z) {
            int i2 = c0938.f4088;
            if (i2 == Integer.MIN_VALUE) {
                i2 = c0938.f4085;
            }
            c0938.f4086 = i2;
            int i3 = c0938.f4084;
            if (i3 == Integer.MIN_VALUE) {
                i3 = c0938.f4089;
            }
            c0938.f4082 = i3;
            return;
        }
        int i4 = c0938.f4084;
        if (i4 == Integer.MIN_VALUE) {
            i4 = c0938.f4085;
        }
        c0938.f4086 = i4;
        int i5 = c0938.f4088;
        if (i5 == Integer.MIN_VALUE) {
            i5 = c0938.f4089;
        }
        c0938.f4082 = i5;
    }

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        C1992 c1992;
        C1578 c1578;
        C0709 c0709 = new C0709(super.onSaveInstanceState());
        C1761 c1761 = this.f234;
        if (c1761 != null && (c1578 = c1761.f7071) != null) {
            c0709.f3242 = c1578.f6340;
        }
        ActionMenuView actionMenuView = this.f230;
        c0709.f3243 = (actionMenuView == null || (c1992 = actionMenuView.f146) == null || !c1992.m5370()) ? false : true;
        return c0709;
    }

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

    public void setBackInvokedCallbackEnabled(boolean z) {
        if (this.f250 != z) {
            this.f250 = z;
            m50();
        }
    }

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

    public void setCollapseContentDescription(CharSequence charSequence) {
        if (!TextUtils.isEmpty(charSequence)) {
            m51();
        }
        C4149 c4149 = this.f231;
        if (c4149 != null) {
            c4149.setContentDescription(charSequence);
        }
    }

    public void setCollapseIcon(int i) {
        setCollapseIcon(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    public void setCollapseIcon(Drawable drawable) {
        if (drawable != null) {
            m51();
            this.f231.setImageDrawable(drawable);
        } else {
            C4149 c4149 = this.f231;
            if (c4149 != null) {
                c4149.setImageDrawable(this.f254);
            }
        }
    }

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

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

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

    public void setLogo(int i) {
        setLogo(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    public void setLogo(Drawable drawable) {
        AppCompatImageView appCompatImageView = this.f251;
        if (drawable != null) {
            if (appCompatImageView == null) {
                this.f251 = new AppCompatImageView(getContext());
            }
            if (!m49(this.f251)) {
                m46(this.f251, true);
            }
        } else if (appCompatImageView != null && m49(appCompatImageView)) {
            removeView(this.f251);
            this.f245.remove(this.f251);
        }
        AppCompatImageView appCompatImageView2 = this.f251;
        if (appCompatImageView2 != null) {
            appCompatImageView2.setImageDrawable(drawable);
        }
    }

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

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

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

    public void setNavigationContentDescription(CharSequence charSequence) {
        if (!TextUtils.isEmpty(charSequence)) {
            m59();
        }
        C4149 c4149 = this.f248;
        if (c4149 != null) {
            c4149.setContentDescription(charSequence);
            ᵺᵘ.ˀᵭ(this.f248, charSequence);
        }
    }

    public void setNavigationIcon(int i) {
        setNavigationIcon(ᵥˇᵛˎ.ᵶˇᵱ(getContext(), i));
    }

    public void setNavigationIcon(Drawable drawable) {
        if (drawable != null) {
            m59();
            if (!m49(this.f248)) {
                m46(this.f248, true);
            }
        } else {
            C4149 c4149 = this.f248;
            if (c4149 != null && m49(c4149)) {
                removeView(this.f248);
                this.f245.remove(this.f248);
            }
        }
        C4149 c41492 = this.f248;
        if (c41492 != null) {
            c41492.setImageDrawable(drawable);
        }
    }

    public void setNavigationOnClickListener(View.OnClickListener onClickListener) {
        m59();
        this.f248.setOnClickListener(onClickListener);
    }

    public void setOnMenuItemClickListener(InterfaceC0366 interfaceC0366) {
    }

    public void setOverflowIcon(Drawable drawable) {
        m54();
        this.f230.setOverflowIcon(drawable);
    }

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

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

    public void setSubtitle(CharSequence charSequence) {
        boolean zIsEmpty = TextUtils.isEmpty(charSequence);
        C4867 c4867 = this.f237;
        if (!zIsEmpty) {
            if (c4867 == null) {
                Context context = getContext();
                C4867 c48672 = new C4867(context, null);
                this.f237 = c48672;
                c48672.setSingleLine();
                this.f237.setEllipsize(TextUtils.TruncateAt.END);
                int i = this.f224;
                if (i != 0) {
                    this.f237.setTextAppearance(context, i);
                }
                ColorStateList colorStateList = this.f216;
                if (colorStateList != null) {
                    this.f237.setTextColor(colorStateList);
                }
            }
            if (!m49(this.f237)) {
                m46(this.f237, true);
            }
        } else if (c4867 != null && m49(c4867)) {
            removeView(this.f237);
            this.f245.remove(this.f237);
        }
        C4867 c48673 = this.f237;
        if (c48673 != null) {
            c48673.setText(charSequence);
        }
        this.f225 = charSequence;
    }

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

    public void setSubtitleTextColor(ColorStateList colorStateList) {
        this.f216 = colorStateList;
        C4867 c4867 = this.f237;
        if (c4867 != null) {
            c4867.setTextColor(colorStateList);
        }
    }

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

    public void setTitle(CharSequence charSequence) {
        boolean zIsEmpty = TextUtils.isEmpty(charSequence);
        C4867 c4867 = this.f242;
        if (!zIsEmpty) {
            if (c4867 == null) {
                Context context = getContext();
                C4867 c48672 = new C4867(context, null);
                this.f242 = c48672;
                c48672.setSingleLine();
                this.f242.setEllipsize(TextUtils.TruncateAt.END);
                int i = this.f244;
                if (i != 0) {
                    this.f242.setTextAppearance(context, i);
                }
                ColorStateList colorStateList = this.f218;
                if (colorStateList != null) {
                    this.f242.setTextColor(colorStateList);
                }
            }
            if (!m49(this.f242)) {
                m46(this.f242, true);
            }
        } else if (c4867 != null && m49(c4867)) {
            removeView(this.f242);
            this.f245.remove(this.f242);
        }
        C4867 c48673 = this.f242;
        if (c48673 != null) {
            c48673.setText(charSequence);
        }
        this.f243 = charSequence;
    }

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

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

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

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

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

    public void setTitleTextColor(ColorStateList colorStateList) {
        this.f218 = colorStateList;
        C4867 c4867 = this.f242;
        if (c4867 != null) {
            c4867.setTextColor(colorStateList);
        }
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m46(View view, boolean z) {
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        C4314 c4314M42 = layoutParams == null ? m42() : !checkLayoutParams(layoutParams) ? m45(layoutParams) : (C4314) layoutParams;
        c4314M42.f16414 = 1;
        if (!z || this.f255 == null) {
            addView(view, c4314M42);
        } else {
            view.setLayoutParams(c4314M42);
            this.f245.add(view);
        }
    }

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public final boolean m47(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 m48(View view, int i, int i2, int i3, int i4) {
        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, marginLayoutParams.height);
        int mode = View.MeasureSpec.getMode(childMeasureSpec2);
        if (mode != 1073741824 && i4 >= 0) {
            if (mode != 0) {
                i4 = Math.min(View.MeasureSpec.getSize(childMeasureSpec2), i4);
            }
            childMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(i4, 1073741824);
        }
        view.measure(childMeasureSpec, childMeasureSpec2);
    }

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

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public final void m50() {
        OnBackInvokedDispatcher onBackInvokedDispatcher;
        if (Build.VERSION.SDK_INT >= 33) {
            OnBackInvokedDispatcher onBackInvokedDispatcherM7826 = AbstractC3418.m7826(this);
            C1761 c1761 = this.f234;
            int i = 0;
            boolean z = (c1761 == null || c1761.f7071 == null || onBackInvokedDispatcherM7826 == null || !isAttachedToWindow() || !this.f250) ? false : true;
            if (z && this.f253 == null) {
                if (this.f249 == null) {
                    this.f249 = new C5535(2, new RunnableC2896(this, i));
                }
                AbstractC3418.m7822(onBackInvokedDispatcherM7826, this.f249);
                this.f253 = onBackInvokedDispatcherM7826;
                return;
            }
            if (z || (onBackInvokedDispatcher = this.f253) == null) {
                return;
            }
            AbstractC3418.m7820(onBackInvokedDispatcher, this.f249);
            this.f253 = null;
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m51() {
        if (this.f231 == null) {
            C4149 c4149 = new C4149(getContext(), null, R.attr.h);
            this.f231 = c4149;
            c4149.setImageDrawable(this.f254);
            this.f231.setContentDescription(this.f221);
            C4314 c4314M42 = m42();
            c4314M42.f16415 = (this.f219 & 112) | 8388611;
            c4314M42.f16414 = 2;
            this.f231.setLayoutParams(c4314M42);
            this.f231.setOnClickListener(new ViewOnClickListenerC1781(5, this));
        }
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final void m52() {
        ArrayList arrayList = this.f223;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayList.get(i);
            i++;
            getMenu().removeItem(((MenuItem) obj).getItemId());
        }
        getMenu();
        ArrayList<MenuItem> currentMenuItems = getCurrentMenuItems();
        getMenuInflater();
        Iterator it = ((CopyOnWriteArrayList) this.f228.ᵔᵖᵹᵫ).iterator();
        while (it.hasNext()) {
            ((C4628) it.next()).f17603.m2347();
        }
        ArrayList<MenuItem> currentMenuItems2 = getCurrentMenuItems();
        currentMenuItems2.removeAll(currentMenuItems);
        this.f223 = currentMenuItems2;
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final int m53(View view, int i, int i2, int[] iArr) {
        C4314 c4314 = (C4314) view.getLayoutParams();
        int i3 = ((ViewGroup.MarginLayoutParams) c4314).rightMargin - iArr[1];
        int iMax = i - Math.max(0, i3);
        iArr[1] = Math.max(0, -i3);
        int iM57 = m57(view, i2);
        int measuredWidth = view.getMeasuredWidth();
        view.layout(iMax - measuredWidth, iM57, iMax, view.getMeasuredHeight() + iM57);
        return iMax - (measuredWidth + ((ViewGroup.MarginLayoutParams) c4314).leftMargin);
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final void m54() {
        m61();
        ActionMenuView actionMenuView = this.f230;
        if (actionMenuView.f145 == null) {
            MenuC3271 menuC3271 = (MenuC3271) actionMenuView.getMenu();
            if (this.f234 == null) {
                this.f234 = new C1761(this);
            }
            this.f230.setExpandedActionViewsExclusive(true);
            menuC3271.m7493(this.f234, this.f236);
            m50();
        }
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public final int m55(View view, int i, int i2, int[] iArr) {
        C4314 c4314 = (C4314) view.getLayoutParams();
        int i3 = ((ViewGroup.MarginLayoutParams) c4314).leftMargin - iArr[0];
        int iMax = Math.max(0, i3) + i;
        iArr[0] = Math.max(0, -i3);
        int iM57 = m57(view, i2);
        int measuredWidth = view.getMeasuredWidth();
        view.layout(iMax, iM57, iMax + measuredWidth, view.getMeasuredHeight() + iM57);
        return measuredWidth + ((ViewGroup.MarginLayoutParams) c4314).rightMargin + iMax;
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public final int m56(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 m57(View view, int i) {
        C4314 c4314 = (C4314) view.getLayoutParams();
        int measuredHeight = view.getMeasuredHeight();
        int i2 = i > 0 ? (measuredHeight - i) / 2 : 0;
        int i3 = c4314.f16415 & 112;
        if (i3 != 16 && i3 != 48 && i3 != 80) {
            i3 = this.f247 & 112;
        }
        if (i3 == 48) {
            return getPaddingTop() - i2;
        }
        if (i3 == 80) {
            return (((getHeight() - getPaddingBottom()) - measuredHeight) - ((ViewGroup.MarginLayoutParams) c4314).bottomMargin) - i2;
        }
        int paddingTop = getPaddingTop();
        int paddingBottom = getPaddingBottom();
        int height = getHeight();
        int iMax = (((height - paddingTop) - paddingBottom) - measuredHeight) / 2;
        int i4 = ((ViewGroup.MarginLayoutParams) c4314).topMargin;
        if (iMax < i4) {
            iMax = i4;
        } else {
            int i5 = (((height - paddingBottom) - measuredHeight) - iMax) - paddingTop;
            int i6 = ((ViewGroup.MarginLayoutParams) c4314).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 void m58(int i, ArrayList arrayList) {
        boolean z = getLayoutDirection() == 1;
        int childCount = getChildCount();
        int absoluteGravity = Gravity.getAbsoluteGravity(i, getLayoutDirection());
        arrayList.clear();
        if (!z) {
            for (int i2 = 0; i2 < childCount; i2++) {
                View childAt = getChildAt(i2);
                C4314 c4314 = (C4314) childAt.getLayoutParams();
                if (c4314.f16414 == 0 && m47(childAt)) {
                    int i3 = c4314.f16415;
                    int layoutDirection = getLayoutDirection();
                    int absoluteGravity2 = Gravity.getAbsoluteGravity(i3, layoutDirection) & 7;
                    if (absoluteGravity2 != 1 && absoluteGravity2 != 3 && absoluteGravity2 != 5) {
                        absoluteGravity2 = layoutDirection == 1 ? 5 : 3;
                    }
                    if (absoluteGravity2 == absoluteGravity) {
                        arrayList.add(childAt);
                    }
                }
            }
            return;
        }
        for (int i4 = childCount - 1; i4 >= 0; i4--) {
            View childAt2 = getChildAt(i4);
            C4314 c43142 = (C4314) childAt2.getLayoutParams();
            if (c43142.f16414 == 0 && m47(childAt2)) {
                int i5 = c43142.f16415;
                int layoutDirection2 = getLayoutDirection();
                int absoluteGravity3 = Gravity.getAbsoluteGravity(i5, layoutDirection2) & 7;
                if (absoluteGravity3 != 1 && absoluteGravity3 != 3 && absoluteGravity3 != 5) {
                    absoluteGravity3 = layoutDirection2 == 1 ? 5 : 3;
                }
                if (absoluteGravity3 == absoluteGravity) {
                    arrayList.add(childAt2);
                }
            }
        }
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final void m59() {
        if (this.f248 == null) {
            this.f248 = new C4149(getContext(), null, R.attr.h);
            C4314 c4314M42 = m42();
            c4314M42.f16415 = (this.f219 & 112) | 8388611;
            this.f248.setLayoutParams(c4314M42);
        }
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final void m60() {
        if (this.f235 == null) {
            C0938 c0938 = new C0938();
            c0938.f4086 = 0;
            c0938.f4082 = 0;
            c0938.f4084 = Integer.MIN_VALUE;
            c0938.f4088 = Integer.MIN_VALUE;
            c0938.f4085 = 0;
            c0938.f4089 = 0;
            c0938.f4087 = false;
            c0938.f4083 = false;
            this.f235 = c0938;
        }
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final void m61() {
        if (this.f230 == null) {
            ActionMenuView actionMenuView = new ActionMenuView(getContext());
            this.f230 = actionMenuView;
            actionMenuView.setPopupTheme(this.f214);
            this.f230.setOnMenuItemClickListener(this.f220);
            ActionMenuView actionMenuView2 = this.f230;
            ˈᵷᵵᵞ r1 = new ˈᵷᵵᵞ(24, this);
            actionMenuView2.getClass();
            actionMenuView2.f140 = r1;
            C4314 c4314M42 = m42();
            c4314M42.f16415 = (this.f219 & 112) | 8388613;
            this.f230.setLayoutParams(c4314M42);
            m46(this.f230, false);
        }
    }
}
