Search in sources :

Example 21 with MenuBuilder

use of com.actionbarsherlock.internal.view.menu.MenuBuilder in project httpclient by pixmob.

the class ActionBarSherlockCompat method initializePanelMenu.

private boolean initializePanelMenu() {
    // getContext();
    Context context = mActivity;
    // If we have an action bar, initialize the menu with a context themed for it.
    if (wActionBar != null) {
        TypedValue outValue = new TypedValue();
        Resources.Theme currentTheme = context.getTheme();
        currentTheme.resolveAttribute(R.attr.actionBarWidgetTheme, outValue, true);
        final int targetThemeRes = outValue.resourceId;
        if (targetThemeRes != 0) /*&& context.getThemeResId() != targetThemeRes*/
        {
            context = new ContextThemeWrapper(context, targetThemeRes);
        }
    }
    mMenu = new MenuBuilder(context);
    mMenu.setCallback(this);
    return true;
}
Also used : Context(android.content.Context) ContextThemeWrapper(android.view.ContextThemeWrapper) Resources(android.content.res.Resources) MenuBuilder(com.actionbarsherlock.internal.view.menu.MenuBuilder) TypedValue(android.util.TypedValue)

Aggregations

MenuBuilder (com.actionbarsherlock.internal.view.menu.MenuBuilder)21 ActionMenuPresenter (com.actionbarsherlock.internal.view.menu.ActionMenuPresenter)14 ActionMenuView (com.actionbarsherlock.internal.view.menu.ActionMenuView)14 Context (android.content.Context)7 Resources (android.content.res.Resources)7 TypedValue (android.util.TypedValue)7 ContextThemeWrapper (android.view.ContextThemeWrapper)7 LayoutInflater (android.view.LayoutInflater)7 View (android.view.View)7 ViewGroup (android.view.ViewGroup)7 TextView (android.widget.TextView)7 SubMenuBuilder (com.actionbarsherlock.internal.view.menu.SubMenuBuilder)7