本文整理汇总了Java中com.actionbarsherlock.internal.widget.ActionBarView.setContextView方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBarView.setContextView方法的具体用法?Java ActionBarView.setContextView怎么用?Java ActionBarView.setContextView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.actionbarsherlock.internal.widget.ActionBarView
的用法示例。
在下文中一共展示了ActionBarView.setContextView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.actionbarsherlock.internal.widget.ActionBarView; //导入方法依赖的package包/类
private void init(View decor) {
mContext = decor.getContext();
mActionView = (ActionBarView) decor.findViewById(R.id.abs__action_bar);
mContextView = (ActionBarContextView) decor.findViewById(
R.id.abs__action_context_bar);
mContainerView = (ActionBarContainer) decor.findViewById(
R.id.abs__action_bar_container);
mSplitView = (ActionBarContainer) decor.findViewById(
R.id.abs__split_action_bar);
if (mActionView == null || mContextView == null || mContainerView == null) {
throw new IllegalStateException(getClass().getSimpleName() + " can only be used " +
"with a compatible window decor layout");
}
mActionView.setContextView(mContextView);
mContextDisplayMode = mActionView.isSplitActionBar() ?
CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
// Older apps get the home button interaction enabled by default.
// Newer apps need to enable it explicitly.
setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion < 14);
setHasEmbeddedTabs(getResources_getBoolean(mContext,
R.bool.abs__action_bar_embed_tabs));
}
示例2: init
import com.actionbarsherlock.internal.widget.ActionBarView; //导入方法依赖的package包/类
private void init(View decor) {
mContext = decor.getContext();
mActionView = (ActionBarView) decor.findViewById(R.id.abs__action_bar);
mContextView = (ActionBarContextView) decor.findViewById(
R.id.abs__action_context_bar);
mContainerView = (ActionBarContainer) decor.findViewById(
R.id.abs__action_bar_container);
mSplitView = (ActionBarContainer) decor.findViewById(
R.id.abs__split_action_bar);
if (mActionView == null || mContextView == null || mContainerView == null) {
throw new IllegalStateException(getClass().getSimpleName() + " can only be used " +
"with a compatible window decor layout");
}
mActionView.setContextView(mContextView);
mContextDisplayMode = mActionView.isSplitActionBar() ?
CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
// Older apps get the home button interaction enabled by default.
// Newer apps need to enable it explicitly.
boolean homeButtonEnabled = mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH;
// If the homeAsUp display option is set, always enable the home button.
homeButtonEnabled |= (mActionView.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0;
setHomeButtonEnabled(homeButtonEnabled);
setHasEmbeddedTabs(getResources_getBoolean(mContext,
R.bool.abs__action_bar_embed_tabs));
}