package p022h;

import android.content.Context;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.view.menu.C0103e;
import androidx.appcompat.widget.ActionBarContextView;
import java.lang.ref.WeakReference;
import p022h.AbstractC0743b;

/* renamed from: h.e */
/* loaded from: classes.dex */
public class C0748e extends AbstractC0743b implements C0103e.InterfaceC0104a {

    /* renamed from: f */
    public Context f2338f;

    /* renamed from: g */
    public ActionBarContextView f2339g;

    /* renamed from: h */
    public AbstractC0743b.InterfaceC0744a f2340h;

    /* renamed from: i */
    public WeakReference<View> f2341i;

    /* renamed from: j */
    public boolean f2342j;

    /* renamed from: k */
    public boolean f2343k;

    /* renamed from: l */
    public C0103e f2344l;

    public C0748e(Context context, ActionBarContextView actionBarContextView, AbstractC0743b.InterfaceC0744a interfaceC0744a, boolean z) {
        this.f2338f = context;
        this.f2339g = actionBarContextView;
        this.f2340h = interfaceC0744a;
        C0103e m4899S = new C0103e(actionBarContextView.getContext()).m4899S(1);
        this.f2344l = m4899S;
        m4899S.mo4815R(this);
        this.f2343k = z;
    }

    @Override // androidx.appcompat.view.menu.C0103e.InterfaceC0104a
    /* renamed from: a */
    public boolean mo3009a(C0103e c0103e, MenuItem menuItem) {
        return this.f2340h.mo2993a(this, menuItem);
    }

    @Override // androidx.appcompat.view.menu.C0103e.InterfaceC0104a
    /* renamed from: b */
    public void mo3008b(C0103e c0103e) {
        mo3001k();
        this.f2339g.m4801l();
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: c */
    public void mo3007c() {
        if (this.f2342j) {
            return;
        }
        this.f2342j = true;
        this.f2340h.mo2990d(this);
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: d */
    public View mo3006d() {
        WeakReference<View> weakReference = this.f2341i;
        if (weakReference != null) {
            return weakReference.get();
        }
        return null;
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: e */
    public Menu mo3005e() {
        return this.f2344l;
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: f */
    public MenuInflater mo3004f() {
        return new C0751g(this.f2339g.getContext());
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: g */
    public CharSequence mo3003g() {
        return this.f2339g.getSubtitle();
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: i */
    public CharSequence mo3002i() {
        return this.f2339g.getTitle();
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: k */
    public void mo3001k() {
        this.f2340h.mo2991c(this, this.f2344l);
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: l */
    public boolean mo3000l() {
        return this.f2339g.m4803j();
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: m */
    public void mo2999m(View view) {
        this.f2339g.setCustomView(view);
        this.f2341i = view != null ? new WeakReference<>(view) : null;
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: n */
    public void mo2998n(int i) {
        mo2997o(this.f2338f.getString(i));
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: o */
    public void mo2997o(CharSequence charSequence) {
        this.f2339g.setSubtitle(charSequence);
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: q */
    public void mo2996q(int i) {
        mo2995r(this.f2338f.getString(i));
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: r */
    public void mo2995r(CharSequence charSequence) {
        this.f2339g.setTitle(charSequence);
    }

    @Override // p022h.AbstractC0743b
    /* renamed from: s */
    public void mo2994s(boolean z) {
        super.mo2994s(z);
        this.f2339g.setTitleOptional(z);
    }
}