com.actionbarsherlock.internal.widget.ActionBarView Java Examples

The following examples show how to use com.actionbarsherlock.internal.widget.ActionBarView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActionBarImpl.java    From android-apps with MIT License 6 votes vote down vote up
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));
}
 
Example #2
Source File: ActionBarImpl.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
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));
}
 
Example #3
Source File: ActionBarImpl.java    From zen4android with MIT License 5 votes vote down vote up
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));
}
 
Example #4
Source File: ActionBarImpl.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
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));
}
 
Example #5
Source File: ActionBarImpl.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
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));
}