/**
* 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);
}
java类android.support.annotation.BoolRes的实例源码
ExternalResources.java 文件源码
项目:external-resources
阅读 37
收藏 0
点赞 0
评论 0
ComposedResources.java 文件源码
项目:SkinFramework
阅读 38
收藏 0
点赞 0
评论 0
@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.java 文件源码
项目:BannerLayout
阅读 45
收藏 0
点赞 0
评论 0
/**
* 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.java 文件源码
项目:BannerLayout
阅读 40
收藏 0
点赞 0
评论 0
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;
}
IdentityProvider.java 文件源码
项目:AppAuth-Demo
阅读 39
收藏 0
点赞 0
评论 0
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");
}
OpenIDIdentityProvider.java 文件源码
项目:jump.android
阅读 31
收藏 0
点赞 0
评论 0
protected OldProvider(
@NonNull String name,
@BoolRes int enabledRes,
@StringRes int discoveryEndpointRes,
@StringRes int authEndpointRes,
@StringRes int tokenEndpointRes,
@StringRes int registrationEndpointRes,
@StringRes int clientIdRes,
@StringRes int redirectUriRes,
@StringRes int scopeRes,
@DrawableRes int buttonImageRes,
@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.java 文件源码
项目:cafebar
阅读 37
收藏 0
点赞 0
评论 0
public Builder showShadow(@BoolRes int res) {
return showShadow(mContext.getResources().getBoolean(res));
}
CafeBar.java 文件源码
项目:cafebar
阅读 35
收藏 0
点赞 0
评论 0
public Builder autoDismiss(@BoolRes int res) {
return autoDismiss(mContext.getResources().getBoolean(res));
}
CafeBar.java 文件源码
项目:cafebar
阅读 36
收藏 0
点赞 0
评论 0
public Builder swipeToDismiss(@BoolRes int res) {
return swipeToDismiss(mContext.getResources().getBoolean(res));
}
CafeBar.java 文件源码
项目:cafebar
阅读 46
收藏 0
点赞 0
评论 0
public Builder floating(@BoolRes int res) {
return floating(mContext.getResources().getBoolean(res));
}
XmppConnectionService.java 文件源码
项目:TenguChat
阅读 39
收藏 0
点赞 0
评论 0
public boolean getBooleanPreference(String name, @BoolRes int res) {
return getPreferences().getBoolean(name,getResources().getBoolean(res));
}
BannerLayout.java 文件源码
项目:BannerLayout
阅读 41
收藏 0
点赞 0
评论 0
/**
* sets whether the viewpager can be swiped, true to prevent sliding
*/
public BannerLayout setViewPagerTouchMode(@BoolRes boolean b) {
this.viePagerTouchMode = b;
return this;
}
BannerLayout.java 文件源码
项目:BannerLayout
阅读 41
收藏 0
点赞 0
评论 0
/**
* Whether the vertical sliding ,The default is not
*/
public BannerLayout setVertical(@BoolRes boolean vertical) {
this.isVertical = vertical;
return this;
}
BottomSheet.java 文件源码
项目:BottomSheet
阅读 37
收藏 0
点赞 0
评论 0
public Builder(@NonNull Context context, @BoolRes int needFocus) {
this.context = context;
bottomSheet = new BottomSheet(context, context.getResources().getBoolean(needFocus));
}
ChipDrawable.java 文件源码
项目:material-components-android
阅读 37
收藏 0
点赞 0
评论 0
public void setChipIconEnabledResource(@BoolRes int id) {
setChipIconEnabled(context.getResources().getBoolean(id));
}
ChipDrawable.java 文件源码
项目:material-components-android
阅读 48
收藏 0
点赞 0
评论 0
public void setCloseIconEnabledResource(@BoolRes int id) {
setCloseIconEnabled(context.getResources().getBoolean(id));
}
ChipDrawable.java 文件源码
项目:material-components-android
阅读 40
收藏 0
点赞 0
评论 0
public void setCheckableResource(@BoolRes int id) {
setCheckable(context.getResources().getBoolean(id));
}
ChipDrawable.java 文件源码
项目:material-components-android
阅读 37
收藏 0
点赞 0
评论 0
public void setCheckedIconEnabledResource(@BoolRes int id) {
setCheckedIconEnabled(context.getResources().getBoolean(id));
}
ChipGroup.java 文件源码
项目:material-components-android
阅读 42
收藏 0
点赞 0
评论 0
/** Sets whether this chip group is single line, or reflowed multiline. */
public void setSingleLine(@BoolRes int id) {
setSingleLine(getResources().getBoolean(id));
}
Chip.java 文件源码
项目:material-components-android
阅读 35
收藏 0
点赞 0
评论 0
public void setChipIconEnabledResource(@BoolRes int id) {
if (chipDrawable != null) {
chipDrawable.setChipIconEnabledResource(id);
}
}
Chip.java 文件源码
项目:material-components-android
阅读 39
收藏 0
点赞 0
评论 0
public void setCloseIconEnabledResource(@BoolRes int id) {
if (chipDrawable != null) {
chipDrawable.setCloseIconEnabledResource(id);
}
}
Chip.java 文件源码
项目:material-components-android
阅读 40
收藏 0
点赞 0
评论 0
public void setCheckableResource(@BoolRes int id) {
if (chipDrawable != null) {
chipDrawable.setCheckableResource(id);
}
}
Chip.java 文件源码
项目:material-components-android
阅读 35
收藏 0
点赞 0
评论 0
public void setCheckedIconEnabledResource(@BoolRes int id) {
if (chipDrawable != null) {
chipDrawable.setCheckedIconEnabledResource(id);
}
}
ResourcesUtil.java 文件源码
项目:Android-App-Template
阅读 42
收藏 0
点赞 0
评论 0
public static boolean getBoolean(@BoolRes int boolRes) {
return ContextUtil.getResources().getBoolean(boolRes);
}
EnumResources.java 文件源码
项目:EnumResources
阅读 40
收藏 0
点赞 0
评论 0
public EnumAssociation assocBoolean(@BoolRes final int boolRes) {
_associations.put(BOOL_FIELD_INDEX, boolRes);
return this;
}
EnumResources.java 文件源码
项目:EnumResources
阅读 42
收藏 0
点赞 0
评论 0
public EnumAssociation assocBoolean(@BoolRes final int boolRes, final Enum<?> enumValue) {
_enumAssociations.put(enumValue.ordinal(), boolRes);
return this;
}
EnumResources.java 文件源码
项目:EnumResources
阅读 44
收藏 0
点赞 0
评论 0
@BoolRes public int getBooleanRes() {
return _associations.get(BOOL_FIELD_INDEX);
}
EnumResources.java 文件源码
项目:EnumResources
阅读 38
收藏 0
点赞 0
评论 0
@BoolRes public int getBooleanRes(final Enum<?> enumValue) {
return _enumAssociations.get(enumValue.ordinal());
}
XmppConnectionService.java 文件源码
项目:Pix-Art-Messenger
阅读 38
收藏 0
点赞 0
评论 0
public boolean getBooleanPreference(String name, @BoolRes int res) {
return getPreferences().getBoolean(name, getResources().getBoolean(res));
}
XmppConnectionService.java 文件源码
项目:Conversations
阅读 39
收藏 0
点赞 0
评论 0
public boolean getBooleanPreference(String name, @BoolRes int res) {
return getPreferences().getBoolean(name, getResources().getBoolean(res));
}