本文整理汇总了Java中com.actionbarsherlock.view.MenuInflater.inflate方法的典型用法代码示例。如果您正苦于以下问题:Java MenuInflater.inflate方法的具体用法?Java MenuInflater.inflate怎么用?Java MenuInflater.inflate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.actionbarsherlock.view.MenuInflater
的用法示例。
在下文中一共展示了MenuInflater.inflate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.results, menu);
MenuItem menuItem = menu.findItem(R.id.menu_share);
ShareActionProvider mShareActionProvider = (ShareActionProvider) menuItem.getActionProvider();
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text, score));
mShareActionProvider.setShareIntent(shareIntent);
return true;
}
示例2: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.play_albums_menu, menu);
MenuItem item = null;
switch (mode) {
case FUNKYSOULS:
item = menu.add(getResources().getString(R.string.funkysouls));
break;
case ALTERPORTAL:
item = menu.add(getResources().getString(R.string.alterportal));
break;
case POST_HARDCORE_RU:
item = menu.add(getResources().getString(R.string.post_hardcore_ru));
break;
}
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true;
}
示例3: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
/**
* Responding to menu items
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
// return true;
final MenuItem refresh = (MenuItem) menu.findItem(R.id.action_refresh);
refresh.setOnMenuItemClickListener(new OnMenuItemClickListener() {
// on selecting show progress spinner for 1s
public boolean onMenuItemClick(MenuItem item) {
// item.setActionView(R.layout.progress_action);
handler.postDelayed(new Runnable() {
public void run() {
refresh.setActionView(null);
}
}, 1000);
return false;
}
});
return super.onCreateOptionsMenu(menu);
}
示例4: InCallControls
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的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);
}
示例5: initControllerView
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
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();
}
示例6: onCreateActionMode
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = mode.getMenuInflater();
mode.setTitle("Download");
inflater.inflate(R.menu.download, menu);
return true; //To change body of implemented methods use File | Settings | File Templates.
}
示例7: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// 메뉴 버튼 구현부분
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.accept, menu);
return true;
}
示例8: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
final int index = pager.getCurrentItem();
if (index == 0) {
inflater.inflate(R.menu.to_playlist_menu, menu);
} else {
inflater.inflate(R.menu.empty_menu, menu);
}
return super.onCreateOptionsMenu(menu);
}
示例9: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
}
示例10: onPrepareOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
MenuInflater inflater = this.getSupportMenuInflater();
inflater.inflate(R.menu.local_identity, menu);
return true;
}
示例11: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// 메뉴 버튼 구현부분
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.cropper, menu);
return true;
}
示例12: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onCreateOptionsMenu(final com.actionbarsherlock.view.Menu menu,
final MenuInflater inflater) {
inflater.inflate(R.menu.queue, menu);
super.onCreateOptionsMenu(menu, inflater);
}
示例13: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater)
{
inflater.inflate(R.menu.request_coins_fragment_options, menu);
final MenuItem shareItem = menu.findItem(R.id.request_coins_options_share);
shareActionProvider = (ShareActionProvider) shareItem.getActionProvider();
updateShareIntent();
super.onCreateOptionsMenu(menu, inflater);
}
示例14: onPrepareOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuInflater inflater = this.getSupportMenuInflater();
menu.clear();
boolean pushRegistered = TextSecurePreferences.isPushRegistered(this);
if (isSingleConversation() && isEncryptedConversation) {
inflater.inflate(R.menu.conversation_secure_identity, menu);
inflater.inflate(R.menu.conversation_secure_sms, menu.findItem(R.id.menu_security).getSubMenu());
} else if (isSingleConversation() && !pushRegistered) {
inflater.inflate(R.menu.conversation_insecure, menu);
}
if (isSingleConversation()) {
inflater.inflate(R.menu.conversation_callable, menu);
} else if (isGroupConversation()) {
inflater.inflate(R.menu.conversation_group_options, menu);
if (!isPushGroupConversation()) {
inflater.inflate(R.menu.conversation_mms_group_options, menu);
if (distributionType == ThreadDatabase.DistributionTypes.BROADCAST) {
menu.findItem(R.id.menu_distribution_broadcast).setChecked(true);
} else {
menu.findItem(R.id.menu_distribution_conversation).setChecked(true);
}
} else if (isActiveGroup()) {
inflater.inflate(R.menu.conversation_push_group_options, menu);
}
}
inflater.inflate(R.menu.conversation, menu);
super.onPrepareOptionsMenu(menu);
return true;
}
示例15: onCreateOptionsMenu
import com.actionbarsherlock.view.MenuInflater; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu optionsMenu, MenuInflater inflater) {
inflater.inflate(menu.code_view, optionsMenu);
wrapItem = optionsMenu.findItem(id.m_wrap);
updateWrapItem();
}