本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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();
}
}