本文整理匯總了Java中com.actionbarsherlock.app.ActionBar.NAVIGATION_MODE_LIST屬性的典型用法代碼示例。如果您正苦於以下問題:Java ActionBar.NAVIGATION_MODE_LIST屬性的具體用法?Java ActionBar.NAVIGATION_MODE_LIST怎麽用?Java ActionBar.NAVIGATION_MODE_LIST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.actionbarsherlock.app.ActionBar
的用法示例。
在下文中一共展示了ActionBar.NAVIGATION_MODE_LIST屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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();
}
}
示例3: 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();
}
}