Java Code Examples for com.actionbarsherlock.app.ActionBar#DISPLAY_HOME_AS_UP

The following examples show how to use com.actionbarsherlock.app.ActionBar#DISPLAY_HOME_AS_UP . 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 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 2
Source File: ActionBarView.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
public void setHomeButtonEnabled(boolean enable) {
    mHomeLayout.setEnabled(enable);
    mHomeLayout.setFocusable(enable);
    // Make sure the home button has an accurate content description for accessibility.
    if (!enable) {
        mHomeLayout.setContentDescription(null);
    } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 3
Source File: ActionBarView.java    From android-apps with MIT License 5 votes vote down vote up
public void setHomeButtonEnabled(boolean enable) {
    mHomeLayout.setEnabled(enable);
    mHomeLayout.setFocusable(enable);
    // Make sure the home button has an accurate content description for accessibility.
    if (!enable) {
        mHomeLayout.setContentDescription(null);
    } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 4
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 5
Source File: ActionBarView.java    From zen4android with MIT License 5 votes vote down vote up
public void setHomeButtonEnabled(boolean enable) {
    mHomeLayout.setEnabled(enable);
    mHomeLayout.setFocusable(enable);
    // Make sure the home button has an accurate content description for accessibility.
    if (!enable) {
        mHomeLayout.setContentDescription(null);
    } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 6
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 7
Source File: ActionBarView.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
public void setHomeButtonEnabled(boolean enable) {
    mHomeLayout.setEnabled(enable);
    mHomeLayout.setFocusable(enable);
    // Make sure the home button has an accurate content description for accessibility.
    if (!enable) {
        mHomeLayout.setContentDescription(null);
    } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 8
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));
}
 
Example 9
Source File: ActionBarView.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
public void setHomeButtonEnabled(boolean enable) {
    mHomeLayout.setEnabled(enable);
    mHomeLayout.setFocusable(enable);
    // Make sure the home button has an accurate content description for accessibility.
    if (!enable) {
        mHomeLayout.setContentDescription(null);
    } else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 10
Source File: ActionBarView.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
public void setDisplayOptions(int options) {
    final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
    mDisplayOptions = options;

    if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
        final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
        final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
        mHomeLayout.setVisibility(vis);

        if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            final boolean setUp = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mHomeLayout.setUp(setUp);

            // Showing home as up implicitly enables interaction with it.
            // In honeycomb it was always enabled, so make this transition
            // a bit easier for developers in the common case.
            // (It would be silly to show it as up without responding to it.)
            if (setUp) {
                setHomeButtonEnabled(true);
            }
        }

        if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
            final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
            mHomeLayout.setIcon(logoVis ? mLogo : mIcon);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
            if ((options & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
                initTitle();
            } else {
                removeView(mTitleLayout);
            }
        }

        if (mTitleLayout != null && (flagsChanged &
                (ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME)) != 0) {
            final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
            mTitleLayout.setEnabled(!showHome && homeAsUp);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {
            if ((options & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
                addView(mCustomNavView);
            } else {
                removeView(mCustomNavView);
            }
        }

        requestLayout();
    } else {
        invalidate();
    }

    // Make sure the home button has an accurate content description for accessibility.
    if (!mHomeLayout.isEnabled()) {
        mHomeLayout.setContentDescription(null);
    } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 11
Source File: ActionBarView.java    From android-apps with MIT License 4 votes vote down vote up
public void setDisplayOptions(int options) {
    final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
    mDisplayOptions = options;

    if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
        final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
        final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
        mHomeLayout.setVisibility(vis);

        if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            final boolean setUp = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mHomeLayout.setUp(setUp);

            // Showing home as up implicitly enables interaction with it.
            // In honeycomb it was always enabled, so make this transition
            // a bit easier for developers in the common case.
            // (It would be silly to show it as up without responding to it.)
            if (setUp) {
                setHomeButtonEnabled(true);
            }
        }

        if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
            final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
            mHomeLayout.setIcon(logoVis ? mLogo : mIcon);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
            if ((options & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
                initTitle();
            } else {
                removeView(mTitleLayout);
            }
        }

        if (mTitleLayout != null && (flagsChanged &
                (ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME)) != 0) {
            final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
            mTitleLayout.setEnabled(!showHome && homeAsUp);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {
            if ((options & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
                addView(mCustomNavView);
            } else {
                removeView(mCustomNavView);
            }
        }

        requestLayout();
    } else {
        invalidate();
    }

    // Make sure the home button has an accurate content description for accessibility.
    if (!mHomeLayout.isEnabled()) {
        mHomeLayout.setContentDescription(null);
    } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 12
Source File: ActionBarView.java    From zen4android with MIT License 4 votes vote down vote up
public void setDisplayOptions(int options) {
    final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
    mDisplayOptions = options;

    if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
        final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
        final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
        mHomeLayout.setVisibility(vis);

        if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            final boolean setUp = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mHomeLayout.setUp(setUp);

            // Showing home as up implicitly enables interaction with it.
            // In honeycomb it was always enabled, so make this transition
            // a bit easier for developers in the common case.
            // (It would be silly to show it as up without responding to it.)
            if (setUp) {
                setHomeButtonEnabled(true);
            }
        }

        if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
            final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
            mHomeLayout.setIcon(logoVis ? mLogo : mIcon);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
            if ((options & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
                initTitle();
            } else {
                removeView(mTitleLayout);
            }
        }

        if (mTitleLayout != null && (flagsChanged &
                (ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME)) != 0) {
            final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
            mTitleLayout.setEnabled(!showHome && homeAsUp);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {
            if ((options & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
                addView(mCustomNavView);
            } else {
                removeView(mCustomNavView);
            }
        }

        requestLayout();
    } else {
        invalidate();
    }

    // Make sure the home button has an accurate content description for accessibility.
    if (!mHomeLayout.isEnabled()) {
        mHomeLayout.setContentDescription(null);
    } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 13
Source File: ActionBarView.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
public void setDisplayOptions(int options) {
    final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
    mDisplayOptions = options;

    if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
        final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
        final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
        mHomeLayout.setVisibility(vis);

        if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            final boolean setUp = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mHomeLayout.setUp(setUp);

            // Showing home as up implicitly enables interaction with it.
            // In honeycomb it was always enabled, so make this transition
            // a bit easier for developers in the common case.
            // (It would be silly to show it as up without responding to it.)
            if (setUp) {
                setHomeButtonEnabled(true);
            }
        }

        if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
            final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
            mHomeLayout.setIcon(logoVis ? mLogo : mIcon);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
            if ((options & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
                initTitle();
            } else {
                removeView(mTitleLayout);
            }
        }

        if (mTitleLayout != null && (flagsChanged &
                (ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME)) != 0) {
            final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
            mTitleLayout.setEnabled(!showHome && homeAsUp);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {
            if ((options & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
                addView(mCustomNavView);
            } else {
                removeView(mCustomNavView);
            }
        }

        requestLayout();
    } else {
        invalidate();
    }

    // Make sure the home button has an accurate content description for accessibility.
    if (!mHomeLayout.isEnabled()) {
        mHomeLayout.setContentDescription(null);
    } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}
 
Example 14
Source File: ActionBarView.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
public void setDisplayOptions(int options) {
    final int flagsChanged = mDisplayOptions == -1 ? -1 : options ^ mDisplayOptions;
    mDisplayOptions = options;

    if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
        final boolean showHome = (options & ActionBar.DISPLAY_SHOW_HOME) != 0;
        final int vis = showHome && mExpandedActionView == null ? VISIBLE : GONE;
        mHomeLayout.setVisibility(vis);

        if ((flagsChanged & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
            final boolean setUp = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mHomeLayout.setUp(setUp);

            // Showing home as up implicitly enables interaction with it.
            // In honeycomb it was always enabled, so make this transition
            // a bit easier for developers in the common case.
            // (It would be silly to show it as up without responding to it.)
            if (setUp) {
                setHomeButtonEnabled(true);
            }
        }

        if ((flagsChanged & ActionBar.DISPLAY_USE_LOGO) != 0) {
            final boolean logoVis = mLogo != null && (options & ActionBar.DISPLAY_USE_LOGO) != 0;
            mHomeLayout.setIcon(logoVis ? mLogo : mIcon);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
            if ((options & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
                initTitle();
            } else {
                removeView(mTitleLayout);
            }
        }

        if (mTitleLayout != null && (flagsChanged &
                (ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME)) != 0) {
            final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
            mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
            mTitleLayout.setEnabled(!showHome && homeAsUp);
        }

        if ((flagsChanged & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {
            if ((options & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
                addView(mCustomNavView);
            } else {
                removeView(mCustomNavView);
            }
        }

        requestLayout();
    } else {
        invalidate();
    }

    // Make sure the home button has an accurate content description for accessibility.
    if (!mHomeLayout.isEnabled()) {
        mHomeLayout.setContentDescription(null);
    } else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_up_description));
    } else {
        mHomeLayout.setContentDescription(mContext.getResources().getText(
                R.string.abs__action_bar_home_description));
    }
}