package ῲ.ῲ.ඓ.㳳;

import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.ActionProvider;
import android.view.ContextMenu;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.RecyclerView;
import ῲ.ᨨ.ᨨ.AbstractC1743;
import ῲ.ᨨ.㸾.K.AbstractMenuItemC1863;
import ῲ.ῲ.ῲ.K.C1940;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ῲ.ඓ.㳳.㳳  reason: contains not printable characters */
/* compiled from: MenuItemImpl */
public final class C1922 implements AbstractMenuItemC1863 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final int f6514;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public C1912 f6515;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public PorterDuff.Mode f6516 = null;

    /* renamed from: ؿ  reason: contains not printable characters */
    public Runnable f6517;

    /* renamed from: ݜ  reason: contains not printable characters */
    public CharSequence f6518;

    /* renamed from: ඓ  reason: contains not printable characters */
    public CharSequence f6519;

    /* renamed from: ᆯ  reason: contains not printable characters */
    public ContextMenu.ContextMenuInfo f6520;

    /* renamed from: ᑓ  reason: contains not printable characters */
    public int f6521 = 16;

    /* renamed from: ᓆ  reason: contains not printable characters */
    public boolean f6522 = false;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public MenuItem.OnMenuItemClickListener f6523;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public int f6524 = RecyclerView.AbstractC0269.FLAG_APPEARED_IN_PRE_LAYOUT;

    /* renamed from: ᝁ  reason: contains not printable characters */
    public boolean f6525 = false;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public int f6526 = RecyclerView.AbstractC0269.FLAG_APPEARED_IN_PRE_LAYOUT;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final int f6527;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public Intent f6528;

    /* renamed from: K  reason: contains not printable characters */
    public final int f6529;

    /* renamed from: ゎ  reason: contains not printable characters */
    public int f6530 = 0;

    /* renamed from: ト  reason: contains not printable characters */
    public View f6531;

    /* renamed from: 㑃  reason: contains not printable characters */
    public Drawable f6532;

    /* renamed from: 㗗  reason: contains not printable characters */
    public SubMenuC1900 f6533;

    /* renamed from: 㗽  reason: contains not printable characters */
    public CharSequence f6534;

    /* renamed from: 㮔  reason: contains not printable characters */
    public AbstractC1743 f6535;

    /* renamed from: 㳳  reason: contains not printable characters */
    public char f6536;

    /* renamed from: 㴪  reason: contains not printable characters */
    public boolean f6537 = false;

    /* renamed from: 㴹  reason: contains not printable characters */
    public CharSequence f6538;

    /* renamed from: 㶋  reason: contains not printable characters */
    public boolean f6539 = false;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final int f6540;

    /* renamed from: 㿎  reason: contains not printable characters */
    public char f6541;

    /* renamed from: 䀟  reason: contains not printable characters */
    public ColorStateList f6542 = null;

    /* renamed from: 䁗  reason: contains not printable characters */
    public int f6543 = 0;

    /* renamed from: 䃖  reason: contains not printable characters */
    public MenuItem.OnActionExpandListener f6544;

    /* renamed from: ῲ.ῲ.ඓ.㳳.㳳$K  reason: contains not printable characters */
    /* compiled from: MenuItemImpl */
    public class C1923 implements AbstractC1743.AbstractC1744 {
        public C1923() {
        }
    }

    public C1922(C1912 r3, int i, int i2, int i3, int i4, CharSequence charSequence, int i5) {
        this.f6515 = r3;
        this.f6529 = i2;
        this.f6527 = i;
        this.f6514 = i3;
        this.f6540 = i4;
        this.f6519 = charSequence;
        this.f6530 = i5;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4962(StringBuilder sb, int i, int i2, String str) {
        if ((i & i2) == i2) {
            sb.append(str);
        }
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public boolean collapseActionView() {
        if ((this.f6530 & 8) == 0) {
            return false;
        }
        if (this.f6531 == null) {
            return true;
        }
        MenuItem.OnActionExpandListener onActionExpandListener = this.f6544;
        if (onActionExpandListener == null || onActionExpandListener.onMenuItemActionCollapse(this)) {
            return this.f6515.collapseItemActionView(this);
        }
        return false;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public boolean expandActionView() {
        if (!m4964()) {
            return false;
        }
        MenuItem.OnActionExpandListener onActionExpandListener = this.f6544;
        if (onActionExpandListener == null || onActionExpandListener.onMenuItemActionExpand(this)) {
            return this.f6515.expandItemActionView(this);
        }
        return false;
    }

    public ActionProvider getActionProvider() {
        throw new UnsupportedOperationException("This is not supported, use MenuItemCompat.getActionProvider()");
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public View getActionView() {
        View view = this.f6531;
        if (view != null) {
            return view;
        }
        AbstractC1743 r0 = this.f6535;
        if (r0 == null) {
            return null;
        }
        this.f6531 = r0.m4541(this);
        return this.f6531;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public int getAlphabeticModifiers() {
        return this.f6524;
    }

    public char getAlphabeticShortcut() {
        return this.f6536;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public CharSequence getContentDescription() {
        return this.f6534;
    }

    public int getGroupId() {
        return this.f6527;
    }

    public Drawable getIcon() {
        Drawable drawable = this.f6532;
        if (drawable != null) {
            return m4968(drawable);
        }
        if (this.f6543 == 0) {
            return null;
        }
        Drawable r0 = C1940.m5017(this.f6515.getContext(), this.f6543);
        this.f6543 = 0;
        this.f6532 = r0;
        return m4968(r0);
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public ColorStateList getIconTintList() {
        return this.f6542;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public PorterDuff.Mode getIconTintMode() {
        return this.f6516;
    }

    public Intent getIntent() {
        return this.f6528;
    }

    @ViewDebug.CapturedViewProperty
    public int getItemId() {
        return this.f6529;
    }

    public ContextMenu.ContextMenuInfo getMenuInfo() {
        return this.f6520;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public int getNumericModifiers() {
        return this.f6526;
    }

    public char getNumericShortcut() {
        return this.f6541;
    }

    public int getOrder() {
        return this.f6514;
    }

    public SubMenu getSubMenu() {
        return this.f6533;
    }

    @ViewDebug.CapturedViewProperty
    public CharSequence getTitle() {
        return this.f6519;
    }

    public CharSequence getTitleCondensed() {
        CharSequence charSequence = this.f6538;
        if (charSequence == null) {
            charSequence = this.f6519;
        }
        int i = Build.VERSION.SDK_INT;
        return charSequence;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public CharSequence getTooltipText() {
        return this.f6518;
    }

    public boolean hasSubMenu() {
        return this.f6533 != null;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public boolean isActionViewExpanded() {
        return this.f6525;
    }

    public boolean isCheckable() {
        return (this.f6521 & 1) == 1;
    }

    public boolean isChecked() {
        return (this.f6521 & 2) == 2;
    }

    public boolean isEnabled() {
        return (this.f6521 & 16) != 0;
    }

    public boolean isVisible() {
        AbstractC1743 r0 = this.f6535;
        if (r0 == null || !r0.m4540()) {
            if ((this.f6521 & 8) == 0) {
                return true;
            }
            return false;
        } else if ((this.f6521 & 8) != 0 || !this.f6535.m4544()) {
            return false;
        } else {
            return true;
        }
    }

    public MenuItem setActionProvider(ActionProvider actionProvider) {
        throw new UnsupportedOperationException("This is not supported, use MenuItemCompat.setActionProvider()");
    }

    public MenuItem setAlphabeticShortcut(char c) {
        if (this.f6536 == c) {
            return this;
        }
        this.f6536 = Character.toLowerCase(c);
        this.f6515.onItemsChanged(false);
        return this;
    }

    public MenuItem setCheckable(boolean z) {
        int i = this.f6521;
        this.f6521 = (z ? 1 : 0) | (i & -2);
        if (i != this.f6521) {
            this.f6515.onItemsChanged(false);
        }
        return this;
    }

    public MenuItem setChecked(boolean z) {
        if ((this.f6521 & 4) != 0) {
            this.f6515.setExclusiveItemChecked(this);
        } else {
            m4971(z);
        }
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setContentDescription(CharSequence charSequence) {
        this.f6534 = charSequence;
        this.f6515.onItemsChanged(false);
        return this;
    }

    public MenuItem setEnabled(boolean z) {
        if (z) {
            this.f6521 |= 16;
        } else {
            this.f6521 &= -17;
        }
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // android.view.MenuItem
    public MenuItem setIcon(Drawable drawable) {
        this.f6543 = 0;
        this.f6532 = drawable;
        this.f6537 = true;
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setIconTintList(ColorStateList colorStateList) {
        this.f6542 = colorStateList;
        this.f6539 = true;
        this.f6537 = true;
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setIconTintMode(PorterDuff.Mode mode) {
        this.f6516 = mode;
        this.f6522 = true;
        this.f6537 = true;
        this.f6515.onItemsChanged(false);
        return this;
    }

    public MenuItem setIntent(Intent intent) {
        this.f6528 = intent;
        return this;
    }

    public MenuItem setNumericShortcut(char c) {
        if (this.f6541 == c) {
            return this;
        }
        this.f6541 = c;
        this.f6515.onItemsChanged(false);
        return this;
    }

    public MenuItem setOnActionExpandListener(MenuItem.OnActionExpandListener onActionExpandListener) {
        this.f6544 = onActionExpandListener;
        return this;
    }

    public MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
        this.f6523 = onMenuItemClickListener;
        return this;
    }

    public MenuItem setShortcut(char c, char c2) {
        this.f6541 = c;
        this.f6536 = Character.toLowerCase(c2);
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public void setShowAsAction(int i) {
        int i2 = i & 3;
        if (i2 == 0 || i2 == 1 || i2 == 2) {
            this.f6530 = i;
            this.f6515.onItemActionRequestChanged(this);
            return;
        }
        throw new IllegalArgumentException("SHOW_AS_ACTION_ALWAYS, SHOW_AS_ACTION_IF_ROOM, and SHOW_AS_ACTION_NEVER are mutually exclusive.");
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setShowAsActionFlags(int i) {
        setShowAsAction(i);
        return this;
    }

    @Override // android.view.MenuItem
    public MenuItem setTitle(CharSequence charSequence) {
        this.f6519 = charSequence;
        this.f6515.onItemsChanged(false);
        SubMenuC1900 r0 = this.f6533;
        if (r0 != null) {
            r0.setHeaderTitle(charSequence);
        }
        return this;
    }

    public MenuItem setTitleCondensed(CharSequence charSequence) {
        this.f6538 = charSequence;
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setTooltipText(CharSequence charSequence) {
        this.f6518 = charSequence;
        this.f6515.onItemsChanged(false);
        return this;
    }

    public MenuItem setVisible(boolean z) {
        if (m4974(z)) {
            this.f6515.onItemVisibleChanged(this);
        }
        return this;
    }

    public String toString() {
        CharSequence charSequence = this.f6519;
        if (charSequence != null) {
            return charSequence.toString();
        }
        return null;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m4963(boolean z) {
        if (z) {
            this.f6521 |= 32;
        } else {
            this.f6521 &= -33;
        }
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean m4965() {
        return (this.f6521 & 4) != 0;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public char m4966() {
        return this.f6515.isQwertyMode() ? this.f6536 : this.f6541;
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public boolean m4972() {
        return this.f6515.isShortcutsVisible() && m4966() != 0;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m4974(boolean z) {
        int i = this.f6521;
        this.f6521 = (z ? 0 : 8) | (i & -9);
        if (i != this.f6521) {
            return true;
        }
        return false;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863, android.view.MenuItem
    public AbstractMenuItemC1863 setActionView(View view) {
        int i;
        this.f6531 = view;
        this.f6535 = null;
        if (view != null && view.getId() == -1 && (i = this.f6529) > 0) {
            view.setId(i);
        }
        this.f6515.onItemActionRequestChanged(this);
        return this;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m4967(boolean z) {
        this.f6521 = (z ? 4 : 0) | (this.f6521 & -5);
    }

    /* renamed from: K  reason: contains not printable characters */
    public final Drawable m4968(Drawable drawable) {
        if (drawable != null && this.f6537 && (this.f6539 || this.f6522)) {
            drawable = C2369.m6273(drawable).mutate();
            if (this.f6539) {
                ColorStateList colorStateList = this.f6542;
                int i = Build.VERSION.SDK_INT;
                drawable.setTintList(colorStateList);
            }
            if (this.f6522) {
                PorterDuff.Mode mode = this.f6516;
                int i2 = Build.VERSION.SDK_INT;
                drawable.setTintMode(mode);
            }
            this.f6537 = false;
        }
        return drawable;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    /* renamed from: setContentDescription  reason: collision with other method in class */
    public AbstractMenuItemC1863 m4975setContentDescription(CharSequence charSequence) {
        this.f6534 = charSequence;
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    /* renamed from: setTooltipText  reason: collision with other method in class */
    public AbstractMenuItemC1863 m4976setTooltipText(CharSequence charSequence) {
        this.f6518 = charSequence;
        this.f6515.onItemsChanged(false);
        return this;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean m4964() {
        AbstractC1743 r0;
        if ((this.f6530 & 8) == 0) {
            return false;
        }
        if (this.f6531 == null && (r0 = this.f6535) != null) {
            this.f6531 = r0.m4541(this);
        }
        if (this.f6531 != null) {
            return true;
        }
        return false;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setAlphabeticShortcut(char c, int i) {
        if (this.f6536 == c && this.f6524 == i) {
            return this;
        }
        this.f6536 = Character.toLowerCase(c);
        this.f6524 = KeyEvent.normalizeMetaState(i);
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setNumericShortcut(char c, int i) {
        if (this.f6541 == c && this.f6526 == i) {
            return this;
        }
        this.f6541 = c;
        this.f6526 = KeyEvent.normalizeMetaState(i);
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    public MenuItem setShortcut(char c, char c2, int i, int i2) {
        this.f6541 = c;
        this.f6526 = KeyEvent.normalizeMetaState(i);
        this.f6536 = Character.toLowerCase(c2);
        this.f6524 = KeyEvent.normalizeMetaState(i2);
        this.f6515.onItemsChanged(false);
        return this;
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public boolean m4973() {
        return (this.f6521 & 32) == 32;
    }

    @Override // android.view.MenuItem
    public MenuItem setIcon(int i) {
        this.f6532 = null;
        this.f6543 = i;
        this.f6537 = true;
        this.f6515.onItemsChanged(false);
        return this;
    }

    @Override // android.view.MenuItem
    public MenuItem setTitle(int i) {
        setTitle(this.f6515.getContext().getString(i));
        return this;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863, android.view.MenuItem
    public MenuItem setActionView(int i) {
        Context context = this.f6515.getContext();
        setActionView(LayoutInflater.from(context).inflate(i, (ViewGroup) new LinearLayout(context), false));
        return this;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4971(boolean z) {
        int i = this.f6521;
        this.f6521 = (z ? 2 : 0) | (i & -3);
        if (i != this.f6521) {
            this.f6515.onItemsChanged(false);
        }
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    /* renamed from: K  reason: contains not printable characters */
    public AbstractC1743 m4969() {
        return this.f6535;
    }

    @Override // ῲ.ᨨ.㸾.K.AbstractMenuItemC1863
    /* renamed from: K  reason: contains not printable characters */
    public AbstractMenuItemC1863 m4970(AbstractC1743 r3) {
        AbstractC1743 r0 = this.f6535;
        if (r0 != null) {
            r0.f6062 = null;
            r0.f6063 = null;
        }
        this.f6531 = null;
        this.f6535 = r3;
        this.f6515.onItemsChanged(true);
        AbstractC1743 r32 = this.f6535;
        if (r32 != null) {
            r32.m4542(new C1923());
        }
        return this;
    }
}
