Example usage for android.widget ActionMenuView generateLayoutParams

List of usage examples for android.widget ActionMenuView generateLayoutParams

Introduction

In this page you can find the example usage for android.widget ActionMenuView generateLayoutParams.

Prototype

@Override
    protected LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) 

Source Link

Usage

From source file:lewa.support.v7.internal.view.menu.ActionMenuPresenter.java

@Override
public View getItemView(MenuItemImpl item, View convertView, ViewGroup parent) {
    View actionView = item.getActionView();
    if (actionView == null || item.hasCollapsibleActionView()) {
        if (!(convertView instanceof ActionMenuItemView)) {
            convertView = null;/*from   w w w . j  a v  a  2s.c om*/
        }
        actionView = super.getItemView(item, convertView, parent);
    }
    actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE);

    final ActionMenuView menuParent = (ActionMenuView) parent;
    final ViewGroup.LayoutParams lp = actionView.getLayoutParams();
    if (!menuParent.checkLayoutParams(lp)) {
        actionView.setLayoutParams(menuParent.generateLayoutParams(lp));
    }
    return actionView;
}