當前位置: 首頁>>代碼示例>>Java>>正文


Java SubMenu類代碼示例

本文整理匯總了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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:MenuBuilder.java

示例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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:MenuWrapper.java

示例3: getSubMenu

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu getSubMenu() {
    if (hasSubMenu() && (mSubMenu == null)) {
        mSubMenu = new SubMenuWrapper(mNativeItem.getSubMenu());
    }
    return mSubMenu;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:MenuItemWrapper.java

示例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);// 設置為不可點擊
}
 
開發者ID:michaelye,項目名稱:DoubanOnline,代碼行數:37,代碼來源:ShareActionBarActivity.java

示例5: addSubMenu

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
public SubMenu addSubMenu(CharSequence title) {
    // TODO Implement submenus
    return null;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:5,代碼來源:ActionMenu.java

示例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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:65,代碼來源:MenuBuilder.java

示例7: SubMenuWrapper

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
public SubMenuWrapper(android.view.SubMenu nativeSubMenu) {
    super(nativeSubMenu);
    mNativeSubMenu = nativeSubMenu;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:5,代碼來源:SubMenuWrapper.java

示例8: setHeaderTitle

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu setHeaderTitle(int titleRes) {
    mNativeSubMenu.setHeaderTitle(titleRes);
    return this;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:6,代碼來源:SubMenuWrapper.java

示例9: setHeaderIcon

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu setHeaderIcon(int iconRes) {
    mNativeSubMenu.setHeaderIcon(iconRes);
    return this;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:6,代碼來源:SubMenuWrapper.java

示例10: setHeaderView

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu setHeaderView(View view) {
    mNativeSubMenu.setHeaderView(view);
    return this;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:6,代碼來源:SubMenuWrapper.java

示例11: setIcon

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu setIcon(int iconRes) {
    mNativeSubMenu.setIcon(iconRes);
    return this;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:6,代碼來源:SubMenuWrapper.java

示例12: addSubMenu

import com.actionbarsherlock.view.SubMenu; //導入依賴的package包/類
@Override
public SubMenu addSubMenu(CharSequence title) {
    return addInternal(mNativeMenu.addSubMenu(title));
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:5,代碼來源:MenuWrapper.java


注:本文中的com.actionbarsherlock.view.SubMenu類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。