本文整理汇总了Java中com.actionbarsherlock.view.SubMenu类的典型用法代码示例。如果您正苦于以下问题:Java SubMenu类的具体用法?Java SubMenu怎么用?Java SubMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubMenu类属于com.actionbarsherlock.view包,在下文中一共展示了SubMenu类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSubMenu
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
public SubMenu addSubMenu(int group, int id, int categoryOrder, CharSequence title) {
final MenuItemImpl item = (MenuItemImpl) addInternal(group, id, categoryOrder, title);
final SubMenuBuilder subMenu = new SubMenuBuilder(mContext, this, item);
item.setSubMenu(subMenu);
return subMenu;
}
示例2: addInternal
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
private SubMenu addInternal(android.view.SubMenu nativeSubMenu) {
SubMenu subMenu = new SubMenuWrapper(nativeSubMenu);
android.view.MenuItem nativeItem = nativeSubMenu.getItem();
MenuItem item = subMenu.getItem();
mNativeMap.put(nativeItem, item);
return subMenu;
}
示例3: getSubMenu
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu getSubMenu() {
if (hasSubMenu() && (mSubMenu == null)) {
mSubMenu = new SubMenuWrapper(mNativeItem.getSubMenu());
}
return mSubMenu;
}
示例4: onCreateOptionsMenu
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getSupportMenuInflater().inflate(R.menu.refresh_share_camera_items, menu);
//刷新
menuRefresh = menu.findItem(R.id.menu_refresh);
menuRefresh.setActionView(R.layout.layout_menu_item_refresh);// 设置为一个ProgressBar
setRefreshState(false);
//分享
mShareActionProvider = (ShareActionProvider) menu.findItem(
R.id.menu_share).getActionProvider();
mShareActionProvider.setShareHistoryFileName(null);// 最经常被使用到的,会记录在这里,首先将这个设置为null(1)
mShareActionProvider.setShareIntent(getDefaultShareIntent());
mShareActionProvider
.setOnShareTargetSelectedListener(new OnShareTargetSelectedListener() {// 并且需要设置这个监听器,自己去启动Intent,就不会被记录到history了(2)
@Override
public boolean onShareTargetSelected(
ShareActionProvider source, Intent intent) {
ShareActionBarActivity.this.startActivity(intent);
return true;
}
});
//TODO 因为没有接口,无法实现,所以隐藏掉
menu.findItem(R.id.menu_camera).setVisible(false);
//是否已经参加了这个活动
SubMenu subMenu = menu.findItem(R.id.menu_camera).getSubMenu();
subItemCamera = subMenu.findItem(R.id.sub_item_camera);
subItemCamera.setEnabled(false);
subItemGallery = subMenu.findItem(R.id.sub_item_photo);
subItemGallery.setEnabled(false);
subItemJoin = subMenu.findItem(R.id.sub_item_join);
subItemJoin.setEnabled(false);
return super.onCreateOptionsMenu(menu);// 设置为不可点击
}
示例5: addSubMenu
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
public SubMenu addSubMenu(CharSequence title) {
// TODO Implement submenus
return null;
}
示例6: bindNativeOverflow
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
public boolean bindNativeOverflow(android.view.Menu menu, android.view.MenuItem.OnMenuItemClickListener listener, HashMap<android.view.MenuItem, MenuItemImpl> map) {
final List<MenuItemImpl> nonActionItems = getNonActionItems();
if (nonActionItems == null || nonActionItems.size() == 0) {
return false;
}
boolean visible = false;
menu.clear();
for (MenuItemImpl nonActionItem : nonActionItems) {
if (!nonActionItem.isVisible()) {
continue;
}
visible = true;
android.view.MenuItem nativeItem;
if (nonActionItem.hasSubMenu()) {
android.view.SubMenu nativeSub = menu.addSubMenu(nonActionItem.getGroupId(), nonActionItem.getItemId(),
nonActionItem.getOrder(), nonActionItem.getTitle());
SubMenuBuilder subMenu = (SubMenuBuilder)nonActionItem.getSubMenu();
for (MenuItemImpl subItem : subMenu.getVisibleItems()) {
android.view.MenuItem nativeSubItem = nativeSub.add(subItem.getGroupId(), subItem.getItemId(),
subItem.getOrder(), subItem.getTitle());
nativeSubItem.setIcon(subItem.getIcon());
nativeSubItem.setOnMenuItemClickListener(listener);
nativeSubItem.setEnabled(subItem.isEnabled());
nativeSubItem.setIntent(subItem.getIntent());
nativeSubItem.setNumericShortcut(subItem.getNumericShortcut());
nativeSubItem.setAlphabeticShortcut(subItem.getAlphabeticShortcut());
nativeSubItem.setTitleCondensed(subItem.getTitleCondensed());
nativeSubItem.setCheckable(subItem.isCheckable());
nativeSubItem.setChecked(subItem.isChecked());
if (subItem.isExclusiveCheckable()) {
nativeSub.setGroupCheckable(subItem.getGroupId(), true, true);
}
map.put(nativeSubItem, subItem);
}
nativeItem = nativeSub.getItem();
} else {
nativeItem = menu.add(nonActionItem.getGroupId(), nonActionItem.getItemId(),
nonActionItem.getOrder(), nonActionItem.getTitle());
}
nativeItem.setIcon(nonActionItem.getIcon());
nativeItem.setOnMenuItemClickListener(listener);
nativeItem.setEnabled(nonActionItem.isEnabled());
nativeItem.setIntent(nonActionItem.getIntent());
nativeItem.setNumericShortcut(nonActionItem.getNumericShortcut());
nativeItem.setAlphabeticShortcut(nonActionItem.getAlphabeticShortcut());
nativeItem.setTitleCondensed(nonActionItem.getTitleCondensed());
nativeItem.setCheckable(nonActionItem.isCheckable());
nativeItem.setChecked(nonActionItem.isChecked());
if (nonActionItem.isExclusiveCheckable()) {
menu.setGroupCheckable(nonActionItem.getGroupId(), true, true);
}
map.put(nativeItem, nonActionItem);
}
return visible;
}
示例7: SubMenuWrapper
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
public SubMenuWrapper(android.view.SubMenu nativeSubMenu) {
super(nativeSubMenu);
mNativeSubMenu = nativeSubMenu;
}
示例8: setHeaderTitle
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu setHeaderTitle(int titleRes) {
mNativeSubMenu.setHeaderTitle(titleRes);
return this;
}
示例9: setHeaderIcon
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu setHeaderIcon(int iconRes) {
mNativeSubMenu.setHeaderIcon(iconRes);
return this;
}
示例10: setHeaderView
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu setHeaderView(View view) {
mNativeSubMenu.setHeaderView(view);
return this;
}
示例11: setIcon
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu setIcon(int iconRes) {
mNativeSubMenu.setIcon(iconRes);
return this;
}
示例12: addSubMenu
import com.actionbarsherlock.view.SubMenu; //导入依赖的package包/类
@Override
public SubMenu addSubMenu(CharSequence title) {
return addInternal(mNativeMenu.addSubMenu(title));
}