本文整理匯總了Java中com.actionbarsherlock.internal.view.menu.MenuItemImpl.setActionViewExpanded方法的典型用法代碼示例。如果您正苦於以下問題:Java MenuItemImpl.setActionViewExpanded方法的具體用法?Java MenuItemImpl.setActionViewExpanded怎麽用?Java MenuItemImpl.setActionViewExpanded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.actionbarsherlock.internal.view.menu.MenuItemImpl
的用法示例。
在下文中一共展示了MenuItemImpl.setActionViewExpanded方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: expandItemActionView
import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入方法依賴的package包/類
@Override
public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) {
mExpandedActionView = item.getActionView();
mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */));
mCurrentExpandedItem = item;
if (mExpandedActionView.getParent() != ActionBarView.this) {
addView(mExpandedActionView);
}
if (mExpandedHomeLayout.getParent() != ActionBarView.this) {
addView(mExpandedHomeLayout);
}
mHomeLayout.setVisibility(GONE);
if (mTitleLayout != null) mTitleLayout.setVisibility(GONE);
if (mTabScrollView != null) mTabScrollView.setVisibility(GONE);
if (mSpinner != null) mSpinner.setVisibility(GONE);
if (mCustomNavView != null) mCustomNavView.setVisibility(GONE);
requestLayout();
item.setActionViewExpanded(true);
if (mExpandedActionView instanceof CollapsibleActionView) {
((CollapsibleActionView) mExpandedActionView).onActionViewExpanded();
}
return true;
}
示例2: collapseItemActionView
import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入方法依賴的package包/類
@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;
}