类android.support.annotation.IntegerRes源码实例Demo

下面列出了怎么用android.support.annotation.IntegerRes的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: AndroidChromium   文件: StatusCardViewHolder.java
public void onBindViewHolder(final DataSource item) {
    super.onBindViewHolder();

    mTitleView.setText(item.getHeader());
    mBodyView.setText(item.getDescription());

    @IntegerRes
    int actionLabel = item.getActionLabel();
    if (actionLabel != 0) {
        mActionView.setText(actionLabel);
        mActionView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                item.performAction(v.getContext());
            }
        });
        mActionView.setVisibility(View.VISIBLE);
    } else {
        mActionView.setVisibility(View.GONE);
    }
}
 
源代码2 项目: external-resources   文件: ExternalResources.java
/**
 * Return an integer 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 integer value contained in the resource.
 * @throws NotFoundException Throws NotFoundException if the given key does not exist.
 */
public int getInteger(@NonNull String key) throws NotFoundException {
  Resource resource = resources.get(key);
  if (null != resource && null != resource.getAsInt()) {
    return resource.getAsInt();
  }

  @IntegerRes int resId = getApplicationResourceIdentifier(key, "integer");

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

    return value;
  }

  throw new NotFoundException("Integer resource with key: " + key);
}
 
源代码3 项目: 365browser   文件: StatusCardViewHolder.java
public void onBindViewHolder(final DataSource item) {
    super.onBindViewHolder();

    mTitleView.setText(item.getHeader());
    mBodyView.setText(item.getDescription());

    @IntegerRes
    int actionLabel = item.getActionLabel();
    if (actionLabel != 0) {
        mActionView.setText(actionLabel);
        mActionView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                SuggestionsMetrics.recordCardActionTapped();
                item.performAction(v.getContext());
            }
        });
        mActionView.setVisibility(View.VISIBLE);
    } else {
        mActionView.setVisibility(View.GONE);
    }
}
 
源代码4 项目: CameraButton   文件: TypedArrayHelper.java
static int getInteger(Context context,
                      TypedArray array,
                      @StyleableRes int attr,
                      @IntegerRes int defaultIntRes) {

    return array.getInteger(
            attr, context.getResources().getInteger(defaultIntRes));
}
 
源代码5 项目: external-resources   文件: ExternalResources.java
/**
 * Return an integer 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 integer value contained in the resource.
 * @throws NotFoundException Throws NotFoundException if the given ID does not exist.
 */
public int getInteger(@IntegerRes int resId) throws NotFoundException {
  String key = getApplicationResourceEntryName(resId);

  if (null != key) {
    Resource resource = resources.get(key);
    if (null != resource && null != resource.getAsInt()) {
      return resource.getAsInt();
    }
  }

  throw new NotFoundException("Integer resource with resId: " + resId);
}
 
源代码6 项目: PracticeDemo   文件: BitmapUtils.java
/**
 * 给bitmap着色
 * @param sourceBitmap
 * @param color  rgb
 * @return
 */
public static Bitmap changeBitmapColor(@NonNull Bitmap sourceBitmap, @IntegerRes int color) {

    Bitmap resultBitmap = Bitmap.createBitmap(sourceBitmap, 0, 0,
            sourceBitmap.getWidth() - 1, sourceBitmap.getHeight() - 1);
    Paint p = new Paint();
    ColorFilter filter = new LightingColorFilter(color, 1);
    p.setColorFilter(filter);

    Canvas canvas = new Canvas(resultBitmap);
    canvas.drawBitmap(resultBitmap, 0, 0, p);
    return resultBitmap;
}
 
源代码7 项目: Android-utils   文件: ResUtils.java
public static int getInteger(@IntegerRes int id) {
    return UtilsApp.getApp().getResources().getInteger(id);
}
 
源代码8 项目: PowerFileExplorer   文件: ResourcesUtil.java
public static int getInteger(@IntegerRes int integerRes) {
    return Base.getResources().getInteger(integerRes);
}
 
public void setPercentCompletion(@IntegerRes int time) {
    PERCENT_COMPLETION = time;
}
 
public void setColorFillCompletion(@IntegerRes int time) {
    COLOR_FILL_ANIMATION = time;
}
 
public void setPrimaryLineCompletion(@IntegerRes int time) {
    FOREGROUND_TIME = time;
}
 
public void setDelayTime(@IntegerRes int time) {
    DELAY_TIME = time;
}
 
源代码13 项目: android-material-motion   文件: BaseFragment.java
protected int duration(@IntegerRes int resource) {
  return getResources().getInteger(resource);
}
 
源代码14 项目: mirror   文件: AppManagerImpl.java
@Override
public int getInteger(@IntegerRes int intResId) {
    return mApplication.getResources().getInteger(intResId);
}
 
源代码15 项目: tribbble   文件: TribbbleApp.java
public static int integer(@IntegerRes int resId) {
  return sContext.getResources().getInteger(resId);
}
 
源代码16 项目: CanDialog   文件: CanDialog.java
public Builder setIcon(@IntegerRes int resId) {
    mDialog.setIcon(resId);

    return this;
}
 
源代码17 项目: CanDialog   文件: CanDialog.java
public Builder setFullBackgroundResource(@IntegerRes int rid) {
    mDialog.setFullBackgroundResource(rid);

    return this;
}
 
源代码18 项目: orz   文件: BaseUtils.java
public static int getIntOfRes(Context context, @IntegerRes int res) {
    return context.getResources().getInteger(res);
}
 
源代码19 项目: DebugDrawer   文件: DebugDrawer.java
/**
 * Set the background color for the Slider from a Resource.
 * This is the view containing the list.
 */
public Builder backgroundColorRes(@IntegerRes int sliderBackgroundColorRes) {
    this.sliderBackgroundColorRes = sliderBackgroundColorRes;
    return this;
}
 
源代码20 项目: Print   文件: PrintView.java
@Override
public void setIconCodeRes(@IntegerRes int resId) {
    getIcon().setIconCodeRes(resId);
}
 
源代码21 项目: Print   文件: PrintDrawable.java
@Override
public void setIconCodeRes(@IntegerRes int resId) {
    setIconCode(mContext.getResources().getInteger(resId));
}
 
源代码22 项目: Print   文件: PrintDrawable.java
public Builder iconCodeRes(@IntegerRes int resId) {
    return iconCode(mContext.getResources().getInteger(resId));
}
 
源代码23 项目: Print   文件: PrintButton.java
@Override
public void setIconCodeRes(@IntegerRes int resId) {
    getIcon().setIconCodeRes(resId);
}
 
源代码24 项目: Qiitanium   文件: AppFragment.java
protected int getInteger(@IntegerRes int resId) {
  return ResUtils.getInteger(getContext(), resId);
}
 
源代码25 项目: Qiitanium   文件: AppActivity.java
protected int getInteger(@IntegerRes int resId) {
  return ResUtils.getInteger(this, resId);
}
 
源代码26 项目: Qiitanium   文件: ResUtils.java
public static int getInteger(Context ctx, @IntegerRes int integerResId) {
  return ctx.getResources().getInteger(integerResId);
}
 
源代码27 项目: SimpleProject   文件: ResourceUtil.java
/**
 * 获取整型值
 * @param resId
 * @return
 */
public int getInteger(@IntegerRes int resId) {
	return BaseContentProvider.context.getResources().getInteger(resId);
}
 
源代码28 项目: mirror   文件: AppManager.java
/**
 * Gets the specified integer ressource.
 *
 * @param intResId The resource id of the integer.
 * @return An {@code int} value.
 */
int getInteger(@IntegerRes int intResId);
 
源代码29 项目: DebugDrawer   文件: DebugDrawer.java
/**
 * Set the background color for the Slider from a Resource.
 * This is the view containing the list.
 */
public Builder backgroundColorRes(@IntegerRes int sliderBackgroundColorRes) {
    return this;
}
 
源代码30 项目: Print   文件: IPrint.java
/**
 * Sets the icon text based on char code from integer resources. Fixed issue of support
 * UTF-16 chars (see <a href="https://github.com/johnkil/Print/issues/11">issue #11</a>)
 *
 * @see #setIconCode(int)
 * @see #getIconText()
 */
void setIconCodeRes(@IntegerRes int resId);
 
 同包方法