package o; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.appcompat.view.menu.MenuItemImpl; import java.util.ArrayList; import o.InterfaceC15933jjG; import o.Sya; /* loaded from: classes.dex */ public abstract class FzA implements InterfaceC15933jjG { public InterfaceC15933jjG.Sts a; public Sya b; public Context c; public NoP d; public int e; private LayoutInflater f; public Context g; private int h; private LayoutInflater i; private int j; public abstract void a(MenuItemImpl menuItemImpl, Sya.HBt hBt); @Override // o.InterfaceC15933jjG public final boolean c(MenuItemImpl menuItemImpl) { return false; } @Override // o.InterfaceC15933jjG public final boolean d(MenuItemImpl menuItemImpl) { return false; } @Override // o.InterfaceC15933jjG public boolean e() { return false; } public boolean e(MenuItemImpl menuItemImpl) { return true; } public FzA(Context context, int i, int i2) { this.g = context; this.i = LayoutInflater.from(context); this.h = i; this.j = i2; } @Override // o.InterfaceC15933jjG public void a(Context context, NoP noP) { this.c = context; this.f = LayoutInflater.from(context); this.d = noP; } public Sya fj_(ViewGroup viewGroup) { if (this.b == null) { Sya sya = (Sya) this.i.inflate(this.h, viewGroup, false); this.b = sya; sya.a(this.d); a(true); } return this.b; } /* JADX WARN: Multi-variable type inference failed */ @Override // o.InterfaceC15933jjG public void a(boolean z) { ViewGroup viewGroup = (ViewGroup) this.b; if (viewGroup == null) { return; } NoP noP = this.d; int i = 0; if (noP != null) { noP.a(); ArrayList d = this.d.d(); int size = d.size(); int i2 = 0; for (int i3 = 0; i3 < size; i3++) { MenuItemImpl menuItemImpl = d.get(i3); if (e(menuItemImpl)) { View childAt = viewGroup.getChildAt(i2); MenuItemImpl a = childAt instanceof Sya.HBt ? ((Sya.HBt) childAt).a() : null; View fi_ = fi_(menuItemImpl, childAt, viewGroup); if (menuItemImpl != a) { fi_.setPressed(false); fi_.jumpDrawablesToCurrentState(); } if (fi_ != childAt) { ViewGroup viewGroup2 = (ViewGroup) fi_.getParent(); if (viewGroup2 != null) { viewGroup2.removeView(fi_); } ((ViewGroup) this.b).addView(fi_, i2); } i2++; } } i = i2; } while (i < viewGroup.getChildCount()) { if (!fh_(viewGroup, i)) { i++; } } } public boolean fh_(ViewGroup viewGroup, int i) { viewGroup.removeViewAt(i); return true; } /* JADX WARN: Multi-variable type inference failed */ public View fi_(MenuItemImpl menuItemImpl, View view, ViewGroup viewGroup) { Sya.HBt hBt; if (view instanceof Sya.HBt) { hBt = (Sya.HBt) view; } else { hBt = (Sya.HBt) this.i.inflate(this.j, viewGroup, false); } a(menuItemImpl, hBt); return (View) hBt; } @Override // o.InterfaceC15933jjG public void b(NoP noP, boolean z) { InterfaceC15933jjG.Sts sts = this.a; if (sts != null) { sts.e(noP, z); } } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r2v4, types: [o.NoP] */ @Override // o.InterfaceC15933jjG public boolean d(SubMenuC16744qqn subMenuC16744qqn) { InterfaceC15933jjG.Sts sts = this.a; SubMenuC16744qqn subMenuC16744qqn2 = subMenuC16744qqn; if (sts == null) { return false; } if (subMenuC16744qqn == null) { subMenuC16744qqn2 = this.d; } return sts.d(subMenuC16744qqn2); } @Override // o.InterfaceC15933jjG public final void c(InterfaceC15933jjG.Sts sts) { this.a = sts; } @Override // o.InterfaceC15933jjG public final int a() { return this.e; } }