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


Java MenuInflater.inflate方法代码示例

本文整理汇总了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;
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:18,代码来源:ResultsActivity.java

示例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;
}
 
开发者ID:PavelKorolev,项目名称:liquid-bear-android,代码行数:20,代码来源:NewcomersSherlockListActivity.java

示例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);
}
 
开发者ID:bhavyanshu,项目名称:CheckIt_Android,代码行数:25,代码来源:MainActivity.java

示例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);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:33,代码来源:InCallControls.java

示例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();
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:28,代码来源:InCallCard.java

示例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.
}
 
开发者ID:Aptoide,项目名称:aptoide-backup-apps,代码行数:8,代码来源:BackedUpCursorAdapter.java

示例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;

}
 
开发者ID:tarksgit,项目名称:Favorite-Android-Client-Example,代码行数:10,代码来源:join.java

示例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);
}
 
开发者ID:PavelKorolev,项目名称:liquid-bear-android,代码行数:12,代码来源:AlbumViewerActivity.java

示例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;
}
 
开发者ID:dbooga,项目名称:MonsterHunter3UDatabase,代码行数:8,代码来源:GenericTabActivity.java

示例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;
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:10,代码来源:ViewLocalIdentityActivity.java

示例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;

}
 
开发者ID:tarksgit,项目名称:Favorite-Android-Client-Example,代码行数:10,代码来源:CropManager.java

示例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);
}
 
开发者ID:micromacer,项目名称:Player-by-TweekProject,代码行数:10,代码来源:QueueFragment.java

示例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);
}
 
开发者ID:9cat,项目名称:templecoin-android-wallet,代码行数:13,代码来源:RequestCoinsFragment.java

示例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;
}
 
开发者ID:Securecom,项目名称:Securecom-Text,代码行数:36,代码来源:ConversationActivity.java

示例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();
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:8,代码来源:GistFileFragment.java


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