微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.support.annotation.BoolRes的实例源码

项目:external-resources    文件ExternalResources.java   
/**
 * Return a boolean associated with a particular resource key. This resource can come from
 * resources you provided via the URL or via default resources.
 *
 * @param key The desired resource key.
 * @return Returns the boolean value contained in the resource.
 * @throws NotFoundException Throws NotFoundException if the given key does not exist.
 */
public boolean getBoolean(@NonNull String key) throws NotFoundException {
  Resource resource = resources.get(key);
  if (null != resource) {
    return resource.getAsBoolean();
  }

  @BoolRes int resId = getApplicationResourceIdentifier(key,"bool");

  if (0 != resId) {
    boolean value = context.getResources().getBoolean(resId);
    resources.add(key,new Resource(value));

    return value;
  }

  throw new NotFoundException("Boolean resource with key: " + key);
}
项目:SkinFramework    文件ComposedResources.java   
@Override
public boolean getBoolean(@BoolRes int id) throws NotFoundException {
    int realId = getCorrespondResId(id);
    if (realId > 0) {
        return mSkinResources.getBoolean(realId);
    }
    return super.getBoolean(id);
}
项目:BannerLayout    文件BannerLayout.java   
/**
 * Initialize the dots control,do not initialize this method if you select custom hint bar
 *
 * @param isBackgroundColor Whether to display the background color
 * @param isVisibleDots     Whether to display small dots,the default display
 * @param isVisibleTitle    Whether to display title,the default is not displayed
 */
public BannerLayout initTips(@BoolRes boolean isBackgroundColor,@BoolRes boolean isVisibleDots,@BoolRes boolean isVisibleTitle) {
    this.isTipsBackground = isBackgroundColor;
    this.isVisibleDots = isVisibleDots;
    this.isVisibleTitle = isVisibleTitle;
    clearBannerTipLayout();
    bannerTipLayout = new BannerTipsLayout(getContext());
    return this;
}
项目:BannerLayout    文件BannerLayout.java   
public BannerLayout switchBanner(@BoolRes boolean isstartRotation) {
    this.isstartRotation = isstartRotation;
    bannerHandlerUtils.removeCallbacksAndMessages(null);
    if (isstartRotation) {
        bannerHandlerUtils.setDelayTime(delayTime);
        bannerHandlerUtils.sendEmptyMessageDelayed(BannerHandlerUtils.MSG_UPDATE,delayTime);
    } else {
        bannerHandlerUtils.sendEmptyMessage(BannerHandlerUtils.MSG_KEEP);
        bannerHandlerUtils.removeCallbacksAndMessages(null);
    }
    return this;
}
项目:AppAuth-Demo    文件IdentityProvider.java   
IdentityProvider(
        @NonNull String name,@BoolRes int enabledRes,@StringRes int discoveryEndpointRes,@StringRes int authEndpointRes,@StringRes int tokenEndpointRes,@StringRes int clientIdRes,@StringRes int clientSecretRes,@StringRes int redirectUriRes,@StringRes int scopeRes,@DrawableRes int buttonImageRes,@StringRes int buttonContentDescriptionRes) {
    if (!isspecified(discoveryEndpointRes)
            && !isspecified(authEndpointRes)
            && !isspecified(tokenEndpointRes)) {
        throw new IllegalArgumentException(
                "the discovery endpoint or the auth and token endpoints must be specified");
    }

    this.name = name;
    this.mEnabledRes = checkSpecified(enabledRes,"enabledRes");
    this.mdiscoveryEndpointRes = discoveryEndpointRes;
    this.mAuthEndpointRes = authEndpointRes;
    this.mTokenEndpointRes = tokenEndpointRes;
    this.mClientIdRes = checkSpecified(clientIdRes,"clientIdRes");
    this.mClientSecretRes = clientSecretRes;
    this.mRedirectUriRes = checkSpecified(redirectUriRes,"redirectUriRes");
    this.mScopeRes = checkSpecified(scopeRes,"scopeRes");
    this.buttonImageRes = checkSpecified(buttonImageRes,"buttonImageRes");
    this.buttonContentDescriptionRes =
            checkSpecified(buttonContentDescriptionRes,"buttonContentDescriptionRes");
}
项目:jump.android    文件OpenIDIdentityProvider.java   
protected OldProvider(
        @NonNull String name,@StringRes int registrationEndpointRes,@StringRes int buttonContentDescriptionRes,@ColorRes int buttonTextColorRes) {
    super(null,buttonImageRes,buttonContentDescriptionRes,buttonTextColorRes,false);
    if (!isResspecified(discoveryEndpointRes)
            && !isResspecified(authEndpointRes)
            && !isResspecified(tokenEndpointRes)) {
        throw new IllegalArgumentException(
                "the discovery endpoint or the auth and token endpoints must be specified");
    }

    this.name = name;
    this.mEnabledRes = checkResspecified(enabledRes,"enabledRes");
    this.mdiscoveryEndpointRes = discoveryEndpointRes;
    this.mAuthEndpointRes = authEndpointRes;
    this.mTokenEndpointRes = tokenEndpointRes;
    this.mRegistrationEndpointRes = registrationEndpointRes;
    this.mClientIdRes = clientIdRes;
    this.mRedirectUriRes = checkResspecified(redirectUriRes,"redirectUriRes");
    this.mScopeRes = checkResspecified(scopeRes,"scopeRes");
}
项目:cafebar    文件CafeBar.java   
public Builder showShadow(@BoolRes int res) {
    return showShadow(mContext.getResources().getBoolean(res));
}
项目:cafebar    文件CafeBar.java   
public Builder autodismiss(@BoolRes int res) {
    return autodismiss(mContext.getResources().getBoolean(res));
}
项目:cafebar    文件CafeBar.java   
public Builder swipetodismiss(@BoolRes int res) {
    return swipetodismiss(mContext.getResources().getBoolean(res));
}
项目:cafebar    文件CafeBar.java   
public Builder floating(@BoolRes int res) {
    return floating(mContext.getResources().getBoolean(res));
}
项目:TenguChat    文件XmppConnectionService.java   
public boolean getBooleanPreference(String name,@BoolRes int res) {
    return getPreferences().getBoolean(name,getResources().getBoolean(res));
}
项目:BannerLayout    文件BannerLayout.java   
/**
 * sets whether the viewpager can be swiped,true to prevent sliding
 */
public BannerLayout setViewPagerTouchMode(@BoolRes boolean b) {
    this.viePagerTouchMode = b;
    return this;
}
项目:BannerLayout    文件BannerLayout.java   
/**
 * Whether the vertical sliding,The default is not
 */
public BannerLayout setVertical(@BoolRes boolean vertical) {
    this.isvertical = vertical;
    return this;
}
项目:BottomSheet    文件BottomSheet.java   
public Builder(@NonNull Context context,@BoolRes int needFocus) {
    this.context = context;
    bottomSheet = new BottomSheet(context,context.getResources().getBoolean(needFocus));
}
项目:material-components-android    文件ChipDrawable.java   
public void setChipIconEnabledResource(@BoolRes int id) {
  setChipIconEnabled(context.getResources().getBoolean(id));
}
项目:material-components-android    文件ChipDrawable.java   
public void setCloseIconEnabledResource(@BoolRes int id) {
  setCloseIconEnabled(context.getResources().getBoolean(id));
}
项目:material-components-android    文件ChipDrawable.java   
public void setCheckableResource(@BoolRes int id) {
  setCheckable(context.getResources().getBoolean(id));
}
项目:material-components-android    文件ChipDrawable.java   
public void setCheckedIconEnabledResource(@BoolRes int id) {
  setCheckedIconEnabled(context.getResources().getBoolean(id));
}
项目:material-components-android    文件ChipGroup.java   
/** Sets whether this chip group is single line,or reflowed multiline. */
public void setSingleLine(@BoolRes int id) {
  setSingleLine(getResources().getBoolean(id));
}
项目:material-components-android    文件Chip.java   
public void setChipIconEnabledResource(@BoolRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setChipIconEnabledResource(id);
  }
}
项目:material-components-android    文件Chip.java   
public void setCloseIconEnabledResource(@BoolRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setCloseIconEnabledResource(id);
  }
}
项目:material-components-android    文件Chip.java   
public void setCheckableResource(@BoolRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setCheckableResource(id);
  }
}
项目:material-components-android    文件Chip.java   
public void setCheckedIconEnabledResource(@BoolRes int id) {
  if (chipDrawable != null) {
    chipDrawable.setCheckedIconEnabledResource(id);
  }
}
项目:Android-App-Template    文件ResourcesUtil.java   
public static boolean getBoolean(@BoolRes int boolRes) {
    return ContextUtil.getResources().getBoolean(boolRes);
}
项目:EnumResources    文件EnumResources.java   
public EnumAssociation assocBoolean(@BoolRes final int boolRes) {
    _associations.put(BOOL_FIELD_INDEX,boolRes);

    return this;
}
项目:EnumResources    文件EnumResources.java   
public EnumAssociation assocBoolean(@BoolRes final int boolRes,final Enum<?> enumValue) {
    _enumAssociations.put(enumValue.ordinal(),boolRes);

    return this;
}
项目:EnumResources    文件EnumResources.java   
@BoolRes public int getBooleanRes() {
    return _associations.get(BOOL_FIELD_INDEX);
}
项目:EnumResources    文件EnumResources.java   
@BoolRes public int getBooleanRes(final Enum<?> enumValue) {
    return _enumAssociations.get(enumValue.ordinal());
}
项目:Pix-Art-Messenger    文件XmppConnectionService.java   
public boolean getBooleanPreference(String name,getResources().getBoolean(res));
}
项目:Conversations    文件XmppConnectionService.java   
public boolean getBooleanPreference(String name,getResources().getBoolean(res));
}
项目:ThemeEngine    文件Theme.java   
/**
 * Gets boolean from theme apk
 */
public static Boolean getBoolean(Context context,@BoolRes int resId) {
    return getBoolean(context,Theme.get(context,resId));
}
项目:external-resources    文件ExternalResources.java   
/**
 * Return a boolean associated with a particular resource ID. This resource can come from
 * resources you provided via the URL or via default resources.
 *
 * @param resId The desired resource identifier,as generated by the aapt
 * tool. This integer encodes the package,type,and resource
 * entry. The value 0 is an invalid identifier.
 * @return Returns the boolean value contained in the resource.
 * @throws NotFoundException Throws NotFoundException if the given ID does not exist.
 */
public boolean getBoolean(@BoolRes int resId) throws NotFoundException {
  String key = getApplicationResourceEntryName(resId);

  if (null == key) {
    throw new NotFoundException("Boolean resource with resId: " + resId);
  }

  return getBoolean(key);
}
项目:simpledialogFragments    文件Check.java   
/**
 * Sets the initial state of the checkBox
 *
 * @param preset initial state as boolean resource
 */
public Check check(@BoolRes int preset){
    this.presetId = preset;
    return this;
}
项目:TwistyTimer    文件DefaultPrefs.java   
/**
 * Returns the boolean value assigned to the resource key
 *
 * @param defaultResID
 *      The resource key ID
 *
 * @return
 *      The resource value
 */
public static boolean getBoolean(@BoolRes int defaultResID) {
    return getRes().getBoolean(defaultResID);
}
项目:material-components-android    文件ChipGroup.java   
/**
 * Sets whether this chip group only allows a single chip to be checked.
 *
 * <p>Calling this method results in all the chips in this group to become unchecked.
 */
public void setSingleSelection(@BoolRes int id) {
  setSingleSelection(getResources().getBoolean(id));
}
项目:material-components-android    文件BottomNavigationView.java   
/**
 * Sets whether the menu items horizontally translate when in shifting mode using a resource ID.
 *
 * @param itemHorizontalTranslation whether the items horizontally translate in shifting mode
 * @see #getItemHorizontalTranslation()
 */
public void setItemHorizontalTranslation(@BoolRes int itemHorizontalTranslation) {
  setItemHorizontalTranslation(getResources().getBoolean(itemHorizontalTranslation));
}
项目:material-components-android    文件TabLayout.java   
/**
 * Set whether tab labels will be displayed inline with tab icons,or if they will be displayed
 * underneath tab icons.
 *
 * @param inlineResourceId Resource ID for boolean inline flag
 * @see #isInlineLabel()
 * @attr ref android.support.design.R.styleable#TabLayout_tabInlineLabel
 */
public void setInlineLabelResource(@BoolRes int inlineResourceId) {
  setInlineLabel(getResources().getBoolean(inlineResourceId));
}
项目:android-tao-core    文件AppResources.java   
/**
 * Return a boolean associated with a particular resource ID.  This can be
 * used with any integral resource value,and will return true if it is
 * non-zero.
 *
 * @param id The desired resource identifier,as generated by the aapt
 *           tool. This integer encodes the package,and resource
 *           entry. The value 0 is an invalid identifier.
 * @return Returns the boolean value contained in the resource.
 * @throws NotFoundException Throws NotFoundException if the given ID does not exist.
 */
public static boolean getBoolean(@BoolRes int id) throws NotFoundException {
   return resources.getBoolean(id);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。