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


Java ActionBar.NAVIGATION_MODE_TABS屬性代碼示例

本文整理匯總了Java中com.actionbarsherlock.app.ActionBar.NAVIGATION_MODE_TABS屬性的典型用法代碼示例。如果您正苦於以下問題:Java ActionBar.NAVIGATION_MODE_TABS屬性的具體用法?Java ActionBar.NAVIGATION_MODE_TABS怎麽用?Java ActionBar.NAVIGATION_MODE_TABS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.actionbarsherlock.app.ActionBar的用法示例。


在下文中一共展示了ActionBar.NAVIGATION_MODE_TABS屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setEmbeddedTabView

public void setEmbeddedTabView(ScrollingTabContainerView tabs) {
    if (mTabScrollView != null) {
        removeView(mTabScrollView);
    }
    mTabScrollView = tabs;
    mIncludeTabs = tabs != null;
    if (mIncludeTabs && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) {
        addView(mTabScrollView);
        ViewGroup.LayoutParams lp = mTabScrollView.getLayoutParams();
        lp.width = LayoutParams.WRAP_CONTENT;
        lp.height = LayoutParams.MATCH_PARENT;
        tabs.setAllowCollapse(true);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:14,代碼來源:ActionBarView.java

示例2: collapseItemActionView

@Override
public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) {
    // Do this before detaching the actionview from the hierarchy, in case
    // it needs to dismiss the soft keyboard, etc.
    if (mExpandedActionView instanceof CollapsibleActionView) {
        ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed();
    }

    removeView(mExpandedActionView);
    removeView(mExpandedHomeLayout);
    mExpandedActionView = null;
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) {
        mHomeLayout.setVisibility(VISIBLE);
    }
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
        if (mTitleLayout == null) {
            initTitle();
        } else {
            mTitleLayout.setVisibility(VISIBLE);
        }
    }
    if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) {
        mTabScrollView.setVisibility(VISIBLE);
    }
    if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) {
        mSpinner.setVisibility(VISIBLE);
    }
    if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
        mCustomNavView.setVisibility(VISIBLE);
    }
    mExpandedHomeLayout.setIcon(null);
    mCurrentExpandedItem = null;
    requestLayout();
    item.setActionViewExpanded(false);

    return true;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:37,代碼來源:ActionBarView.java

示例3: setEmbeddedTabView

public void setEmbeddedTabView(ScrollingTabContainerView tabs) {
    if (mTabScrollView != null) {
        removeView(mTabScrollView);
    }
    mTabScrollView = tabs;
    mIncludeTabs = tabs != null;
    if (mIncludeTabs && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) {
        addView(mTabScrollView);
        LayoutParams lp = mTabScrollView.getLayoutParams();
        lp.width = LayoutParams.WRAP_CONTENT;
        lp.height = LayoutParams.MATCH_PARENT;
        tabs.setAllowCollapse(true);
    }
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:14,代碼來源:ActionBarView.java

示例4: setNavigationMode

public void setNavigationMode(int mode) {
    final int oldMode = mNavigationMode;
    if (mode != oldMode) {
        switch (oldMode) {
        case ActionBar.NAVIGATION_MODE_LIST:
            if (mListNavLayout != null) {
                removeView(mListNavLayout);
            }
            break;
        case ActionBar.NAVIGATION_MODE_TABS:
            if (mTabScrollView != null && mIncludeTabs) {
                removeView(mTabScrollView);
            }
        }

        switch (mode) {
        case ActionBar.NAVIGATION_MODE_LIST:
            if (mSpinner == null) {
                mSpinner = new IcsSpinner(mContext, null,
                        R.attr.actionDropDownStyle);
                mListNavLayout = (IcsLinearLayout) LayoutInflater.from(mContext)
                        .inflate(R.layout.abs__action_bar_tab_bar_view, null);
                LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                        LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
                params.gravity = Gravity.CENTER;
                mListNavLayout.addView(mSpinner, params);
            }
            if (mSpinner.getAdapter() != mSpinnerAdapter) {
                mSpinner.setAdapter(mSpinnerAdapter);
            }
            mSpinner.setOnItemSelectedListener(mNavItemSelectedListener);
            addView(mListNavLayout);
            break;
        case ActionBar.NAVIGATION_MODE_TABS:
            if (mTabScrollView != null && mIncludeTabs) {
                addView(mTabScrollView);
            }
            break;
        }
        mNavigationMode = mode;
        requestLayout();
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:43,代碼來源:ActionBarView.java

示例5: setNavigationMode

public void setNavigationMode(int mode) {
    final int oldMode = mNavigationMode;
    if (mode != oldMode) {
        switch (oldMode) {
            case ActionBar.NAVIGATION_MODE_LIST:
                if (mListNavLayout != null) {
                    removeView(mListNavLayout);
                }
                break;
            case ActionBar.NAVIGATION_MODE_TABS:
                if (mTabScrollView != null && mIncludeTabs) {
                    removeView(mTabScrollView);
                }
        }

        switch (mode) {
            case ActionBar.NAVIGATION_MODE_LIST:
                if (mSpinner == null) {
                    mSpinner = new IcsSpinner(mContext, null,
                            R.attr.actionDropDownStyle);
                    mListNavLayout = (IcsLinearLayout) LayoutInflater.from(mContext)
                            .inflate(R.layout.abs__action_bar_tab_bar_view, null);
                    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                            LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
                    params.gravity = Gravity.CENTER;
                    mListNavLayout.addView(mSpinner, params);
                }
                if (mSpinner.getAdapter() != mSpinnerAdapter) {
                    mSpinner.setAdapter(mSpinnerAdapter);
                }
                mSpinner.setOnItemSelectedListener(mNavItemSelectedListener);
                addView(mListNavLayout);
                break;
            case ActionBar.NAVIGATION_MODE_TABS:
                if (mTabScrollView != null && mIncludeTabs) {
                    addView(mTabScrollView);
                }
                break;
        }
        mNavigationMode = mode;
        requestLayout();
    }
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:43,代碼來源:ActionBarView.java


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