Search in sources :

Example 1 with ListMenuPresenter

use of android.support.v7.internal.view.menu.ListMenuPresenter in project HoloEverywhere by Prototik.

the class ActionBarActivityDelegateBase method getListMenuView.

private MenuView getListMenuView(Context context, MenuPresenter.Callback cb) {
    if (mMenu == null) {
        return null;
    }
    if (mListMenuPresenter == null) {
        TypedArray a = context.obtainStyledAttributes(R.styleable.Theme);
        final int listPresenterTheme = a.getResourceId(R.styleable.Theme_panelMenuListTheme, R.style.Theme_AppCompat_CompactMenu);
        a.recycle();
        mListMenuPresenter = new ListMenuPresenter(R.layout.abc_list_menu_item_layout, listPresenterTheme);
        mListMenuPresenter.setCallback(cb);
        mMenu.addMenuPresenter(mListMenuPresenter);
    } else {
        // Make sure we update the ListView
        mListMenuPresenter.updateMenuView(false);
    }
    return mListMenuPresenter.getMenuView(new FrameLayout(context));
}
Also used : TypedArray(android.content.res.TypedArray) FrameLayout(org.holoeverywhere.widget.FrameLayout) ListMenuPresenter(android.support.v7.internal.view.menu.ListMenuPresenter)

Aggregations

TypedArray (android.content.res.TypedArray)1 ListMenuPresenter (android.support.v7.internal.view.menu.ListMenuPresenter)1 FrameLayout (org.holoeverywhere.widget.FrameLayout)1