当前位置: 首页>>代码示例>>Java>>正文


Java ActionMenuView类代码示例

本文整理汇总了Java中com.actionbarsherlock.internal.view.menu.ActionMenuView的典型用法代码示例。如果您正苦于以下问题:Java ActionMenuView类的具体用法?Java ActionMenuView怎么用?Java ActionMenuView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ActionMenuView类属于com.actionbarsherlock.internal.view.menu包,在下文中一共展示了ActionMenuView类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateMenuView

import com.actionbarsherlock.internal.view.menu.ActionMenuView; //导入依赖的package包/类
private void updateMenuView() {
    int w = getWidth();
    if(w <= 0) {
        w = getResources().getDisplayMetrics().widthPixels;
    }
    w -= 100;
    if(!added) {
        final LayoutParams layoutParams = new LayoutParams(
                LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        ViewGroup menuViewWrapper = (ViewGroup) findViewById(R.id.call_action_bar);
        mActionMenuPresenter.setReserveOverflow(true);
        mActionMenuPresenter.setWidthLimit(w, true);
        // Use width limit (this means we don't care item limits 
        mActionMenuPresenter.setItemLimit(20);
        ActionMenuView menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(menuViewWrapper);
        UtilityWrapper.getInstance().setBackgroundDrawable(menuView, null);
        menuViewWrapper.addView(menuView, layoutParams);
        added = true;
    }else {
        mActionMenuPresenter.setWidthLimit(w, true);
        mActionMenuPresenter.updateMenuView(true);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:24,代码来源:InCallCard.java

示例2: InCallControls

import com.actionbarsherlock.internal.view.menu.ActionMenuView; //导入依赖的package包/类
public InCallControls(Context context, AttributeSet attrs, int style) {
    super(context, attrs, style);
    
    if(!isInEditMode()) {
        supportMultipleCalls = SipConfigManager.getPreferenceBooleanValue(getContext(), SipConfigManager.SUPPORT_MULTIPLE_CALLS, false);
    }
    
    final LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
            (int) getResources().getDimension(R.dimen.incall_bottom_bar_height));
    ActionMenuPresenter mActionMenuPresenter = new ActionMenuPresenter(getContext()) {
        public void bindItemView(MenuItemImpl item, MenuView.ItemView itemView) {
            super.bindItemView(item, itemView);
            View actionItemView = (View) itemView;
            actionItemView.setBackgroundResource(R.drawable.btn_compound_background);
        }
    };
    mActionMenuPresenter.setReserveOverflow(true);
    // Full width
    mActionMenuPresenter.setWidthLimit(
            getContext().getResources().getDisplayMetrics().widthPixels, true);
    // We use width limit, no need to limit items.
    mActionMenuPresenter.setItemLimit(20);
    btnMenuBuilder = new MenuBuilder(getContext());
    btnMenuBuilder.setCallback(this);
    MenuInflater inflater = new MenuInflater(getContext());
    inflater.inflate(R.menu.in_call_controls_menu, btnMenuBuilder);
    btnMenuBuilder.addMenuPresenter(mActionMenuPresenter);
    ActionMenuView menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
    menuView.setBackgroundResource(R.drawable.abs__ab_bottom_transparent_dark_holo);
    
    this.addView(menuView, layoutParams);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:33,代码来源:InCallControls.java


注:本文中的com.actionbarsherlock.internal.view.menu.ActionMenuView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。