本文整理匯總了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));
}