Java Code Examples for com.actionbarsherlock.internal.view.menu.MenuBuilder#addMenuPresenter()

The following examples show how to use com.actionbarsherlock.internal.view.menu.MenuBuilder#addMenuPresenter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InCallControls.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: InCallCard.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
private void initControllerView() {
    photo = (ImageView) findViewById(R.id.contact_photo);
    remoteName = (TextView) findViewById(R.id.contact_name_display_name);
    remoteSipAddress = (TextView) findViewById(R.id.contact_name_sip_address);
    elapsedTime = (Chronometer) findViewById(R.id.elapsedTime);
    callStatusText = (TextView) findViewById(R.id.call_status_text);
    callSecureBar = (ViewGroup) findViewById(R.id.call_secure_bar);
    callSecureText = (TextView) findViewById(R.id.call_secure_text);
    endCallBar = (ViewGroup) findViewById(R.id.end_call_bar);


    View btn;
    btn = findViewById(R.id.endButton);
    btn.setOnClickListener(this);

    btnMenuBuilder = new MenuBuilder(getContext());
    btnMenuBuilder.setCallback(this);
    MenuInflater inflater = new MenuInflater(getContext());
    inflater.inflate(R.menu.in_call_card_menu, btnMenuBuilder);
    
    mActionMenuPresenter = new ActionMenuPresenter(getContext());
    mActionMenuPresenter.setReserveOverflow(true);
    
    btnMenuBuilder.addMenuPresenter(mActionMenuPresenter);
    
    updateMenuView();
}
 
Example 3
Source File: ActionBarView.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
private void configPresenters(MenuBuilder builder) {
    if (builder != null) {
        builder.addMenuPresenter(mActionMenuPresenter);
        builder.addMenuPresenter(mExpandedMenuPresenter);
    } else {
        mActionMenuPresenter.initForMenu(mContext, null);
        mExpandedMenuPresenter.initForMenu(mContext, null);
        mActionMenuPresenter.updateMenuView(true);
        mExpandedMenuPresenter.updateMenuView(true);
    }
}
 
Example 4
Source File: ActionBarView.java    From android-apps with MIT License 5 votes vote down vote up
private void configPresenters(MenuBuilder builder) {
    if (builder != null) {
        builder.addMenuPresenter(mActionMenuPresenter);
        builder.addMenuPresenter(mExpandedMenuPresenter);
    } else {
        mActionMenuPresenter.initForMenu(mContext, null);
        mExpandedMenuPresenter.initForMenu(mContext, null);
        mActionMenuPresenter.updateMenuView(true);
        mExpandedMenuPresenter.updateMenuView(true);
    }
}
 
Example 5
Source File: ActionBarView.java    From zen4android with MIT License 5 votes vote down vote up
private void configPresenters(MenuBuilder builder) {
    if (builder != null) {
        builder.addMenuPresenter(mActionMenuPresenter);
        builder.addMenuPresenter(mExpandedMenuPresenter);
    } else {
        mActionMenuPresenter.initForMenu(mContext, null);
        mExpandedMenuPresenter.initForMenu(mContext, null);
        mActionMenuPresenter.updateMenuView(true);
        mExpandedMenuPresenter.updateMenuView(true);
    }
}
 
Example 6
Source File: ActionBarView.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
private void configPresenters(MenuBuilder builder) {
    if (builder != null) {
        builder.addMenuPresenter(mActionMenuPresenter);
        builder.addMenuPresenter(mExpandedMenuPresenter);
    } else {
        mActionMenuPresenter.initForMenu(mContext, null);
        mExpandedMenuPresenter.initForMenu(mContext, null);
        mActionMenuPresenter.updateMenuView(true);
        mExpandedMenuPresenter.updateMenuView(true);
    }
}
 
Example 7
Source File: ActionBarView.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
private void configPresenters(MenuBuilder builder) {
    if (builder != null) {
        builder.addMenuPresenter(mActionMenuPresenter);
        builder.addMenuPresenter(mExpandedMenuPresenter);
    } else {
        mActionMenuPresenter.initForMenu(mContext, null);
        mExpandedMenuPresenter.initForMenu(mContext, null);
        mActionMenuPresenter.updateMenuView(true);
        mExpandedMenuPresenter.updateMenuView(true);
    }
}