當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。