本文整理汇总了Java中com.actionbarsherlock.view.CollapsibleActionView类的典型用法代码示例。如果您正苦于以下问题:Java CollapsibleActionView类的具体用法?Java CollapsibleActionView怎么用?Java CollapsibleActionView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CollapsibleActionView类属于com.actionbarsherlock.view包,在下文中一共展示了CollapsibleActionView类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expandItemActionView
import com.actionbarsherlock.view.CollapsibleActionView; //导入依赖的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: setActionView
import com.actionbarsherlock.view.CollapsibleActionView; //导入依赖的package包/类
@Override
public MenuItem setActionView(int resId) {
//Allow the native menu to inflate the resource
mNativeItem.setActionView(resId);
if (resId != 0) {
//Get newly created view
View view = mNativeItem.getActionView();
if (view instanceof CollapsibleActionView) {
//Wrap it and re-set it
mNativeItem.setActionView(new CollapsibleActionViewWrapper(view));
}
}
return this;
}
示例3: collapseItemActionView
import com.actionbarsherlock.view.CollapsibleActionView; //导入依赖的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;
}