com.actionbarsherlock.view.MenuInflater Java Examples

The following examples show how to use com.actionbarsherlock.view.MenuInflater. 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: DialerFragment.java    From CSipSimple with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    int action = getResources().getBoolean(R.bool.menu_in_bar) ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
    MenuItem delMenu = menu.add(isDigit ? R.string.switch_to_text : R.string.switch_to_digit);
    delMenu.setIcon(
            isDigit ? R.drawable.ic_menu_switch_txt
                    : R.drawable.ic_menu_switch_digit).setShowAsAction( action );
    delMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            setTextDialing(isDigit);
            return true;
        }
    });
}
 
Example #2
Source File: LessonsFragmentSupport.java    From zhangshangwuda with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
	menu.add(Menu.NONE, MENU_ADD, 1,
			getResources().getString(R.string.Lessons_add_lessons))
			.setIcon(R.drawable.ic_menu_new)
			.setShowAsAction(
					MenuItem.SHOW_AS_ACTION_IF_ROOM
							| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
	if (ACTIONBAR_MODEL == 1) {
		menu.add(Menu.NONE, MENU_TODAY, 2,
				getResources().getString(R.string.Lessons_go_today))
				.setIcon(R.drawable.ic_menu_today)
				.setShowAsAction(
						MenuItem.SHOW_AS_ACTION_IF_ROOM
								| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
	}
	menu.add(Menu.NONE, MENU_LOGOFF, 3,
			getResources().getString(R.string.logoff))
			.setIcon(R.drawable.ic_menu_logoff)
			.setShowAsAction(
					MenuItem.SHOW_AS_ACTION_IF_ROOM
							| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
}
 
Example #3
Source File: MessageFragment.java    From CSipSimple with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    int actionRoom = getResources().getBoolean(R.bool.menu_in_bar) ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
    MenuItem addContactMenu = menu.add(R.string.menu_add_to_contacts);
    addContactMenu.setIcon(R.drawable.ic_add_contact_holo_dark).setShowAsAction(actionRoom);
    addContactMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            Intent it = ContactsWrapper.getInstance().getAddContactIntent(null, remoteFrom);
            startActivity(it);
            return true;
        }
    });
}
 
Example #4
Source File: AccountFiltersListFragment.java    From CSipSimple with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
       menu.add(R.string.add_filter)
               .setIcon(android.R.drawable.ic_menu_add)
               .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
                   @Override
                   public boolean onMenuItemClick(MenuItem item) {
                       onClickAddFilter();
                       return true;
                   }
               })
               .setShowAsAction(
                       MenuItem.SHOW_AS_ACTION_IF_ROOM );

	
	super.onCreateOptionsMenu(menu, inflater);
}
 
Example #5
Source File: FollowersAdapter.java    From buddycloud-android with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreateActionMode(ActionMode mode, Menu menu) {
	MenuInflater inflater = mode.getMenuInflater();
	inflater.inflate(R.menu.channel_followers_options, menu);
	if (!SubscribedChannelsModel.canMakeModerator(role)) {
		MenuItem menuModerator = menu.findItem(R.id.menu_role_moderator);
		menuModerator.setVisible(false);
	}
}
 
Example #6
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 #7
Source File: PostNewTopicActivity.java    From buddycloud-android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	MenuInflater inflater = getSupportMenuInflater();
       inflater.inflate(R.menu.post_screen_options, menu);

	return super.onCreateOptionsMenu(menu);
}
 
Example #8
Source File: LoginActivity.java    From buddycloud-android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
	MenuInflater inflater = getSupportMenuInflater();
       inflater.inflate(R.menu.login_screen_options, menu);
	
       MenuItem item = menu.findItem(R.id.menu_signup);
       if (item != null) {
       	item.setTitle(getString(R.string.signup_button).toUpperCase(Locale.ENGLISH));
       }
       
	return super.onCreateOptionsMenu(menu);
}
 
Example #9
Source File: join.java    From Favorite-Android-Client with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {

	// 메뉴 버튼 구현부분
	MenuInflater inflater = getSupportMenuInflater();
	inflater.inflate(R.menu.accept, menu);
	return true;

}
 
Example #10
Source File: tarks_account_login.java    From Favorite-Android-Client with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {

	// 메뉴 버튼 구현부분
	MenuInflater inflater = getSupportMenuInflater();
	inflater.inflate(R.menu.accept, menu);
	return true;

}
 
Example #11
Source File: CropManager.java    From Favorite-Android-Client with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {

	// 메뉴 버튼 구현부분
	MenuInflater inflater = getSupportMenuInflater();
	inflater.inflate(R.menu.cropper, menu);
	return true;

}
 
Example #12
Source File: SherlockListFragment.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    //Nothing to see here.
}
 
Example #13
Source File: SherlockListFragment.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
    onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
 
Example #14
Source File: ActionBarImpl.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
@Override
public MenuInflater getMenuInflater() {
    return new MenuInflater(getThemedContext());
}
 
Example #15
Source File: SherlockDialogFragment.java    From zen4android with MIT License 4 votes vote down vote up
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    //Nothing to see here.
}
 
Example #16
Source File: SherlockDialogFragment.java    From zen4android with MIT License 4 votes vote down vote up
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
    onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
 
Example #17
Source File: ActionBarSherlockNative.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
@Override
public MenuInflater getMenuInflater() {
    return ActionBarSherlockNative.this.getMenuInflater();
}
 
Example #18
Source File: HoneycombAbsHelper.java    From PopupMenuCompat with MIT License 4 votes vote down vote up
@Override
public MenuInflater getMenuInflater()
{
	return new Bridge.ActionBarSherlock.MenuInflater( getContext(), menu.getMenuInflater() );
}
 
Example #19
Source File: SherlockFragment.java    From zen4android with MIT License 4 votes vote down vote up
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
    onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
 
Example #20
Source File: SherlockActivity.java    From zen4android with MIT License 4 votes vote down vote up
public MenuInflater getSupportMenuInflater() {
    return getSherlock().getMenuInflater();
}
 
Example #21
Source File: SherlockFragmentActivity.java    From zen4android with MIT License 4 votes vote down vote up
public MenuInflater getSupportMenuInflater() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getSupportMenuInflater]");

    return getSherlock().getMenuInflater();
}
 
Example #22
Source File: MyBaseAdapter.java    From MultiChoiceAdapter with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.my_action_mode, menu);
    return true;
}
 
Example #23
Source File: ActionBarSherlockNative.java    From android-apps with MIT License 4 votes vote down vote up
@Override
public MenuInflater getMenuInflater() {
    return ActionBarSherlockNative.this.getMenuInflater();
}
 
Example #24
Source File: SherlockListActivity.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
public MenuInflater getSupportMenuInflater() {
    return getSherlock().getMenuInflater();
}
 
Example #25
Source File: SherlockListFragment.java    From zen4android with MIT License 4 votes vote down vote up
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
    onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
 
Example #26
Source File: SherlockPreferenceActivity.java    From zen4android with MIT License 4 votes vote down vote up
public MenuInflater getSupportMenuInflater() {
    return getSherlock().getMenuInflater();
}
 
Example #27
Source File: SherlockFragment.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
@Override
public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
    onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
}
 
Example #28
Source File: NonCheckableItemsAdapter.java    From MultiChoiceAdapter with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.my_action_mode, menu);
    return true;
}
 
Example #29
Source File: MainPrefs.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.main_prefs, menu);
    return super.onCreateOptionsMenu(menu);
}
 
Example #30
Source File: StandaloneActionMode.java    From zen4android with MIT License 4 votes vote down vote up
@Override
public MenuInflater getMenuInflater() {
    return new MenuInflater(mContext);
}