本文整理汇总了Java中android.support.annotation.BoolRes类的典型用法代码示例。如果您正苦于以下问题:Java BoolRes类的具体用法?Java BoolRes怎么用?Java BoolRes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoolRes类属于android.support.annotation包,在下文中一共展示了BoolRes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBoolean
import android.support.annotation.BoolRes; //导入依赖的package包/类
/**
* 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);
}
示例2: getBoolean
import android.support.annotation.BoolRes; //导入依赖的package包/类
@Override
public boolean getBoolean(@BoolRes int id) throws NotFoundException {
int realId = getCorrespondResId(id);
if (realId > 0) {
return mSkinResources.getBoolean(realId);
}
return super.getBoolean(id);
}
示例3: initTips
import android.support.annotation.BoolRes; //导入依赖的package包/类
/**
* 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;
}
示例4: switchBanner
import android.support.annotation.BoolRes; //导入依赖的package包/类
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;
}
示例5: IdentityProvider
import android.support.annotation.BoolRes; //导入依赖的package包/类
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");
}
示例6: OldProvider
import android.support.annotation.BoolRes; //导入依赖的package包/类
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");
}
示例7: showShadow
import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder showShadow(@BoolRes int res) {
return showShadow(mContext.getResources().getBoolean(res));
}
示例8: autoDismiss
import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder autoDismiss(@BoolRes int res) {
return autoDismiss(mContext.getResources().getBoolean(res));
}
示例9: swipeToDismiss
import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder swipeToDismiss(@BoolRes int res) {
return swipeToDismiss(mContext.getResources().getBoolean(res));
}
示例10: floating
import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder floating(@BoolRes int res) {
return floating(mContext.getResources().getBoolean(res));
}
示例11: getBooleanPreference
import android.support.annotation.BoolRes; //导入依赖的package包/类
public boolean getBooleanPreference(String name, @BoolRes int res) {
return getPreferences().getBoolean(name,getResources().getBoolean(res));
}
示例12: setViewPagerTouchMode
import android.support.annotation.BoolRes; //导入依赖的package包/类
/**
* sets whether the viewpager can be swiped, true to prevent sliding
*/
public BannerLayout setViewPagerTouchMode(@BoolRes boolean b) {
this.viePagerTouchMode = b;
return this;
}
示例13: setVertical
import android.support.annotation.BoolRes; //导入依赖的package包/类
/**
* Whether the vertical sliding ,The default is not
*/
public BannerLayout setVertical(@BoolRes boolean vertical) {
this.isVertical = vertical;
return this;
}
示例14: Builder
import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder(@NonNull Context context, @BoolRes int needFocus) {
this.context = context;
bottomSheet = new BottomSheet(context, context.getResources().getBoolean(needFocus));
}
示例15: setChipIconEnabledResource
import android.support.annotation.BoolRes; //导入依赖的package包/类
public void setChipIconEnabledResource(@BoolRes int id) {
setChipIconEnabled(context.getResources().getBoolean(id));
}