what-the-bank/sources/androidx/appcompat/view/menu/MenuItemWrapperICS.java

489 lines
14 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package androidx.appcompat.view.menu;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.view.ActionProvider;
import android.view.CollapsibleActionView;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.widget.FrameLayout;
import java.lang.reflect.Method;
import o.AbstractC1032UcS;
import o.JPw;
import o.hbU;
import o.tkI;
/* loaded from: classes.dex */
public final class MenuItemWrapperICS extends AbstractC1032UcS implements MenuItem {
private Method a;
private final tkI c;
public MenuItemWrapperICS(Context context, tkI tki) {
super(context);
if (tki == null) {
throw new IllegalArgumentException("Wrapped Object can not be null.");
}
this.c = tki;
}
@Override // android.view.MenuItem
public final int getItemId() {
return this.c.getItemId();
}
@Override // android.view.MenuItem
public final int getGroupId() {
return this.c.getGroupId();
}
@Override // android.view.MenuItem
public final int getOrder() {
return this.c.getOrder();
}
@Override // android.view.MenuItem
public final MenuItem setTitle(CharSequence charSequence) {
this.c.setTitle(charSequence);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setTitle(int i) {
this.c.setTitle(i);
return this;
}
@Override // android.view.MenuItem
public final CharSequence getTitle() {
return this.c.getTitle();
}
@Override // android.view.MenuItem
public final MenuItem setTitleCondensed(CharSequence charSequence) {
this.c.setTitleCondensed(charSequence);
return this;
}
@Override // android.view.MenuItem
public final CharSequence getTitleCondensed() {
return this.c.getTitleCondensed();
}
@Override // android.view.MenuItem
public final MenuItem setIcon(Drawable drawable) {
this.c.setIcon(drawable);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setIcon(int i) {
this.c.setIcon(i);
return this;
}
@Override // android.view.MenuItem
public final Drawable getIcon() {
return this.c.getIcon();
}
@Override // android.view.MenuItem
public final MenuItem setIntent(Intent intent) {
this.c.setIntent(intent);
return this;
}
@Override // android.view.MenuItem
public final Intent getIntent() {
return this.c.getIntent();
}
@Override // android.view.MenuItem
public final MenuItem setShortcut(char c, char c2) {
this.c.setShortcut(c, c2);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setShortcut(char c, char c2, int i, int i2) {
this.c.setShortcut(c, c2, i, i2);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setNumericShortcut(char c) {
this.c.setNumericShortcut(c);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setNumericShortcut(char c, int i) {
this.c.setNumericShortcut(c, i);
return this;
}
@Override // android.view.MenuItem
public final char getNumericShortcut() {
return this.c.getNumericShortcut();
}
@Override // android.view.MenuItem
public final int getNumericModifiers() {
return this.c.getNumericModifiers();
}
@Override // android.view.MenuItem
public final MenuItem setAlphabeticShortcut(char c) {
this.c.setAlphabeticShortcut(c);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setAlphabeticShortcut(char c, int i) {
this.c.setAlphabeticShortcut(c, i);
return this;
}
@Override // android.view.MenuItem
public final char getAlphabeticShortcut() {
return this.c.getAlphabeticShortcut();
}
@Override // android.view.MenuItem
public final int getAlphabeticModifiers() {
return this.c.getAlphabeticModifiers();
}
@Override // android.view.MenuItem
public final MenuItem setCheckable(boolean z) {
this.c.setCheckable(z);
return this;
}
@Override // android.view.MenuItem
public final boolean isCheckable() {
return this.c.isCheckable();
}
@Override // android.view.MenuItem
public final MenuItem setChecked(boolean z) {
this.c.setChecked(z);
return this;
}
@Override // android.view.MenuItem
public final boolean isChecked() {
return this.c.isChecked();
}
@Override // android.view.MenuItem
public final MenuItem setVisible(boolean z) {
return this.c.setVisible(z);
}
@Override // android.view.MenuItem
public final boolean isVisible() {
return this.c.isVisible();
}
@Override // android.view.MenuItem
public final MenuItem setEnabled(boolean z) {
this.c.setEnabled(z);
return this;
}
@Override // android.view.MenuItem
public final boolean isEnabled() {
return this.c.isEnabled();
}
@Override // android.view.MenuItem
public final boolean hasSubMenu() {
return this.c.hasSubMenu();
}
@Override // android.view.MenuItem
public final SubMenu getSubMenu() {
return ey_(this.c.getSubMenu());
}
@Override // android.view.MenuItem
public final MenuItem setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
this.c.setOnMenuItemClickListener(onMenuItemClickListener != null ? new Sts(this, onMenuItemClickListener) : null);
return this;
}
@Override // android.view.MenuItem
public final ContextMenu.ContextMenuInfo getMenuInfo() {
return this.c.getMenuInfo();
}
@Override // android.view.MenuItem
public final void setShowAsAction(int i) {
this.c.setShowAsAction(i);
}
@Override // android.view.MenuItem
public final MenuItem setShowAsActionFlags(int i) {
this.c.setShowAsActionFlags(i);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setActionView(View view) {
if (view instanceof CollapsibleActionView) {
view = new CollapsibleActionViewWrapper(view);
}
this.c.setActionView(view);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setActionView(int i) {
this.c.setActionView(i);
View actionView = this.c.getActionView();
if (actionView instanceof CollapsibleActionView) {
this.c.setActionView(new CollapsibleActionViewWrapper(actionView));
}
return this;
}
@Override // android.view.MenuItem
public final View getActionView() {
View actionView = this.c.getActionView();
return actionView instanceof CollapsibleActionViewWrapper ? (View) ((CollapsibleActionViewWrapper) actionView).c : actionView;
}
@Override // android.view.MenuItem
public final MenuItem setActionProvider(ActionProvider actionProvider) {
LWm lWm = new LWm(this, this.e, actionProvider);
tkI tki = this.c;
if (actionProvider == null) {
lWm = null;
}
tki.c(lWm);
return this;
}
@Override // android.view.MenuItem
public final ActionProvider getActionProvider() {
hbU e = this.c.e();
if (e instanceof HBt) {
return ((HBt) e).c;
}
return null;
}
@Override // android.view.MenuItem
public final boolean expandActionView() {
return this.c.expandActionView();
}
@Override // android.view.MenuItem
public final boolean collapseActionView() {
return this.c.collapseActionView();
}
@Override // android.view.MenuItem
public final boolean isActionViewExpanded() {
return this.c.isActionViewExpanded();
}
@Override // android.view.MenuItem
public final MenuItem setOnActionExpandListener(MenuItem.OnActionExpandListener onActionExpandListener) {
this.c.setOnActionExpandListener(onActionExpandListener != null ? new RVV(this, onActionExpandListener) : null);
return this;
}
@Override // android.view.MenuItem
public final MenuItem setContentDescription(CharSequence charSequence) {
this.c.setContentDescription(charSequence);
return this;
}
@Override // android.view.MenuItem
public final CharSequence getContentDescription() {
return this.c.getContentDescription();
}
@Override // android.view.MenuItem
public final MenuItem setTooltipText(CharSequence charSequence) {
this.c.setTooltipText(charSequence);
return this;
}
@Override // android.view.MenuItem
public final CharSequence getTooltipText() {
return this.c.getTooltipText();
}
@Override // android.view.MenuItem
public final MenuItem setIconTintList(ColorStateList colorStateList) {
this.c.setIconTintList(colorStateList);
return this;
}
@Override // android.view.MenuItem
public final ColorStateList getIconTintList() {
return this.c.getIconTintList();
}
@Override // android.view.MenuItem
public final MenuItem setIconTintMode(PorterDuff.Mode mode) {
this.c.setIconTintMode(mode);
return this;
}
@Override // android.view.MenuItem
public final PorterDuff.Mode getIconTintMode() {
return this.c.getIconTintMode();
}
public final void b() {
try {
if (this.a == null) {
this.a = this.c.getClass().getDeclaredMethod("setExclusiveCheckable", Boolean.TYPE);
}
this.a.invoke(this.c, Boolean.TRUE);
} catch (Exception unused) {
}
}
/* loaded from: classes.dex */
class Sts implements MenuItem.OnMenuItemClickListener {
private final MenuItem.OnMenuItemClickListener b;
final MenuItemWrapperICS e;
Sts(MenuItemWrapperICS menuItemWrapperICS, MenuItem.OnMenuItemClickListener onMenuItemClickListener) {
this.e = menuItemWrapperICS;
this.b = onMenuItemClickListener;
}
@Override // android.view.MenuItem.OnMenuItemClickListener
public final boolean onMenuItemClick(MenuItem menuItem) {
return this.b.onMenuItemClick(this.e.ex_(menuItem));
}
}
/* loaded from: classes.dex */
class RVV implements MenuItem.OnActionExpandListener {
private final MenuItem.OnActionExpandListener a;
final MenuItemWrapperICS b;
RVV(MenuItemWrapperICS menuItemWrapperICS, MenuItem.OnActionExpandListener onActionExpandListener) {
this.b = menuItemWrapperICS;
this.a = onActionExpandListener;
}
@Override // android.view.MenuItem.OnActionExpandListener
public final boolean onMenuItemActionExpand(MenuItem menuItem) {
return this.a.onMenuItemActionExpand(this.b.ex_(menuItem));
}
@Override // android.view.MenuItem.OnActionExpandListener
public final boolean onMenuItemActionCollapse(MenuItem menuItem) {
return this.a.onMenuItemActionCollapse(this.b.ex_(menuItem));
}
}
/* loaded from: classes.dex */
class HBt extends hbU {
final ActionProvider c;
final MenuItemWrapperICS e;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
HBt(MenuItemWrapperICS menuItemWrapperICS, Context context, ActionProvider actionProvider) {
super(context);
this.e = menuItemWrapperICS;
this.c = actionProvider;
}
@Override // o.hbU
public View a() {
return this.c.onCreateActionView();
}
@Override // o.hbU
public boolean e() {
return this.c.onPerformDefaultAction();
}
@Override // o.hbU
public boolean b() {
return this.c.hasSubMenu();
}
@Override // o.hbU
public void qR_(SubMenu subMenu) {
this.c.onPrepareSubMenu(this.e.ey_(subMenu));
}
}
/* loaded from: classes.dex */
class LWm extends HBt implements ActionProvider.VisibilityListener {
final MenuItemWrapperICS a;
private hbU.Sts d;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
LWm(MenuItemWrapperICS menuItemWrapperICS, Context context, ActionProvider actionProvider) {
super(menuItemWrapperICS, context, actionProvider);
this.a = menuItemWrapperICS;
}
@Override // o.hbU
public View qQ_(MenuItem menuItem) {
return this.c.onCreateActionView(menuItem);
}
@Override // o.hbU
public boolean c() {
return this.c.overridesItemVisibility();
}
@Override // o.hbU
public boolean d() {
return this.c.isVisible();
}
@Override // o.hbU
public void d(hbU.Sts sts) {
this.d = sts;
this.c.setVisibilityListener(sts != null ? this : null);
}
@Override // android.view.ActionProvider.VisibilityListener
public void onActionProviderVisibilityChanged(boolean z) {
hbU.Sts sts = this.d;
if (sts != null) {
sts.e();
}
}
}
/* loaded from: classes.dex */
static class CollapsibleActionViewWrapper extends FrameLayout implements JPw {
final CollapsibleActionView c;
/* JADX WARN: Multi-variable type inference failed */
CollapsibleActionViewWrapper(View view) {
super(view.getContext());
this.c = (CollapsibleActionView) view;
addView(view);
}
@Override // o.JPw
public final void c() {
this.c.onActionViewExpanded();
}
@Override // o.JPw
public final void b() {
this.c.onActionViewCollapsed();
}
}
}