当前位置: 首页>>代码示例>>Java>>正文


Java ActionBar.DISPLAY_SHOW_TITLE属性代码示例

本文整理汇总了Java中com.actionbarsherlock.app.ActionBar.DISPLAY_SHOW_TITLE属性的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.DISPLAY_SHOW_TITLE属性的具体用法?Java ActionBar.DISPLAY_SHOW_TITLE怎么用?Java ActionBar.DISPLAY_SHOW_TITLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.actionbarsherlock.app.ActionBar的用法示例。


在下文中一共展示了ActionBar.DISPLAY_SHOW_TITLE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConfigurationChanged

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    mTitleView = null;
    mSubtitleView = null;
    mTitleUpView = null;
    if (mTitleLayout != null && mTitleLayout.getParent() == this) {
        removeView(mTitleLayout);
    }
    mTitleLayout = null;
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
        initTitle();
    }

    if (mTabScrollView != null && mIncludeTabs) {
        ViewGroup.LayoutParams lp = mTabScrollView.getLayoutParams();
        if (lp != null) {
            lp.width = LayoutParams.WRAP_CONTENT;
            lp.height = LayoutParams.MATCH_PARENT;
        }
        mTabScrollView.setAllowCollapse(true);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:24,代码来源:ActionBarView.java

示例2: onConfigurationChanged

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    mTitleView = null;
    mSubtitleView = null;
    mTitleUpView = null;
    if (mTitleLayout != null && mTitleLayout.getParent() == this) {
        removeView(mTitleLayout);
    }
    mTitleLayout = null;
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
        initTitle();
    }

    if (mTabScrollView != null && mIncludeTabs) {
        LayoutParams lp = mTabScrollView.getLayoutParams();
        if (lp != null) {
            lp.width = LayoutParams.WRAP_CONTENT;
            lp.height = LayoutParams.MATCH_PARENT;
        }
        mTabScrollView.setAllowCollapse(true);
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-backup-apps,代码行数:24,代码来源:ActionBarView.java

示例3: setTitleImpl

private void setTitleImpl(CharSequence title) {
    mTitle = title;
    if (mTitleView != null) {
        mTitleView.setText(title);
        final boolean visible = mExpandedActionView == null &&
                (mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0 &&
                (!TextUtils.isEmpty(mTitle) || !TextUtils.isEmpty(mSubtitle));
        mTitleLayout.setVisibility(visible ? VISIBLE : GONE);
    }
    if (mLogoNavItem != null) {
        mLogoNavItem.setTitle(title);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:ActionBarView.java

示例4: setSubtitle

public void setSubtitle(CharSequence subtitle) {
    mSubtitle = subtitle;
    if (mSubtitleView != null) {
        mSubtitleView.setText(subtitle);
        mSubtitleView.setVisibility(subtitle != null ? VISIBLE : GONE);
        final boolean visible = mExpandedActionView == null &&
                (mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0 &&
                (!TextUtils.isEmpty(mTitle) || !TextUtils.isEmpty(mSubtitle));
        mTitleLayout.setVisibility(visible ? VISIBLE : GONE);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:11,代码来源:ActionBarView.java

示例5: collapseItemActionView

@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;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:37,代码来源:ActionBarView.java

示例6: setDisplayOptions

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));
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:66,代码来源:ActionBarView.java


注:本文中的com.actionbarsherlock.app.ActionBar.DISPLAY_SHOW_TITLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。