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


Java BoolRes类代码示例

本文整理汇总了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);
}
 
开发者ID:prcaen,项目名称:external-resources,代码行数:26,代码来源:ExternalResources.java

示例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);
}
 
开发者ID:Zeal27,项目名称:SkinFramework,代码行数:9,代码来源:ComposedResources.java

示例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;
}
 
开发者ID:7449,项目名称:BannerLayout,代码行数:18,代码来源:BannerLayout.java

示例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;
}
 
开发者ID:7449,项目名称:BannerLayout,代码行数:13,代码来源:BannerLayout.java

示例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");
}
 
开发者ID:iainmcgin,项目名称:AppAuth-Demo,代码行数:33,代码来源:IdentityProvider.java

示例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");
}
 
开发者ID:janrain,项目名称:jump.android,代码行数:32,代码来源:OpenIDIdentityProvider.java

示例7: showShadow

import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder showShadow(@BoolRes int res) {
    return showShadow(mContext.getResources().getBoolean(res));
}
 
开发者ID:danimahardhika,项目名称:cafebar,代码行数:4,代码来源:CafeBar.java

示例8: autoDismiss

import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder autoDismiss(@BoolRes int res) {
    return autoDismiss(mContext.getResources().getBoolean(res));
}
 
开发者ID:danimahardhika,项目名称:cafebar,代码行数:4,代码来源:CafeBar.java

示例9: swipeToDismiss

import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder swipeToDismiss(@BoolRes int res) {
    return swipeToDismiss(mContext.getResources().getBoolean(res));
}
 
开发者ID:danimahardhika,项目名称:cafebar,代码行数:4,代码来源:CafeBar.java

示例10: floating

import android.support.annotation.BoolRes; //导入依赖的package包/类
public Builder floating(@BoolRes int res) {
    return floating(mContext.getResources().getBoolean(res));
}
 
开发者ID:danimahardhika,项目名称:cafebar,代码行数:4,代码来源:CafeBar.java

示例11: getBooleanPreference

import android.support.annotation.BoolRes; //导入依赖的package包/类
public boolean getBooleanPreference(String name, @BoolRes int res) {
	return getPreferences().getBoolean(name,getResources().getBoolean(res));
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:4,代码来源:XmppConnectionService.java

示例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;
}
 
开发者ID:7449,项目名称:BannerLayout,代码行数:8,代码来源:BannerLayout.java

示例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;
}
 
开发者ID:7449,项目名称:BannerLayout,代码行数:8,代码来源:BannerLayout.java

示例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));
}
 
开发者ID:michaelbel,项目名称:BottomSheet,代码行数:5,代码来源:BottomSheet.java

示例15: setChipIconEnabledResource

import android.support.annotation.BoolRes; //导入依赖的package包/类
public void setChipIconEnabledResource(@BoolRes int id) {
  setChipIconEnabled(context.getResources().getBoolean(id));
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:4,代码来源:ChipDrawable.java


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