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);
}
}
java类android.support.annotation.IntegerRes的实例源码
StatusCardViewHolder.java 文件源码
项目:chromium-for-android-56-debug-video
阅读 44
收藏 0
点赞 0
评论 0
StatusCardViewHolder.java 文件源码
项目:AndroidChromium
阅读 50
收藏 0
点赞 0
评论 0
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);
}
}
ExternalResources.java 文件源码
项目:external-resources
阅读 59
收藏 0
点赞 0
评论 0
/**
* 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);
}
StatusCardViewHolder.java 文件源码
项目:365browser
阅读 36
收藏 0
点赞 0
评论 0
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);
}
}
ComposedResources.java 文件源码
项目:SkinFramework
阅读 43
收藏 0
点赞 0
评论 0
@Override
public int getInteger(@IntegerRes int id) throws NotFoundException {
int realId = getCorrespondResId(id);
if (realId > 0) {
return mSkinResources.getInteger(realId);
}
return super.getInteger(id);
}
TypedArrayHelper.java 文件源码
项目:CameraButton
阅读 46
收藏 0
点赞 0
评论 0
static int getInteger(Context context,
TypedArray array,
@StyleableRes int attr,
@IntegerRes int defaultIntRes) {
return array.getInteger(
attr, context.getResources().getInteger(defaultIntRes));
}
SkyTimeBackgroundView.java 文件源码
项目:TimeSkyBackground
阅读 37
收藏 0
点赞 0
评论 0
public void setBackgroundGradient(@IntegerRes int i, @IntegerRes int ii, @IntegerRes int iii) {
mSkyTime = Time.CUSTOM;
mDrawables[0] = i;
mDrawables[1] = ii;
mDrawables[2] = iii;
}
XmppConnectionService.java 文件源码
项目:TenguChat
阅读 51
收藏 0
点赞 0
评论 0
public long getLongPreference(String name, @IntegerRes int res) {
long defaultValue = getResources().getInteger(res);
try {
return Long.parseLong(getPreferences().getString(name,String.valueOf(defaultValue)));
} catch (NumberFormatException e) {
return defaultValue;
}
}
PreferencesHelper.java 文件源码
项目:PageIndicatorView
阅读 41
收藏 0
点赞 0
评论 0
/**
* Get an integer from preferences
*
* @param context application context
* @param key preference key
* @param defaultValue default value
* @return integer
*/
public static int getInteger(@NonNull Context context, @StringRes int key, @IntegerRes int defaultValue) {
SharedPreferences sharedPreferences = context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
String integerAsString = sharedPreferences.getString(context.getString(key), null);
if (integerAsString == null) {
return context.getResources().getInteger(defaultValue);
} else {
return Integer.valueOf(integerAsString);
}
}
ExternalResources.java 文件源码
项目:external-resources
阅读 49
收藏 0
点赞 0
评论 0
/**
* 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);
}
BitmapUtils.java 文件源码
项目:PracticeDemo
阅读 59
收藏 0
点赞 0
评论 0
/**
* 给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;
}
XmppConnectionService.java 文件源码
项目:Pix-Art-Messenger
阅读 39
收藏 0
点赞 0
评论 0
public long getLongPreference(String name, @IntegerRes int res) {
long defaultValue = getResources().getInteger(res);
try {
return Long.parseLong(getPreferences().getString(name,String.valueOf(defaultValue)));
} catch (NumberFormatException e) {
return defaultValue;
}
}
XmppConnectionService.java 文件源码
项目:Conversations
阅读 42
收藏 0
点赞 0
评论 0
public long getLongPreference(String name, @IntegerRes int res) {
long defaultValue = getResources().getInteger(res);
try {
return Long.parseLong(getPreferences().getString(name, String.valueOf(defaultValue)));
} catch (NumberFormatException e) {
return defaultValue;
}
}
BaseFragment.java 文件源码
项目:Material-Motion
阅读 40
收藏 0
点赞 0
评论 0
protected int duration(@IntegerRes int resource){
return getResources().getInteger(resource);
}
AppIconLoader.java 文件源码
项目:disclosure-android-app
阅读 49
收藏 0
点赞 0
评论 0
public Builder withPlaceholder(@IntegerRes Integer placeholderRes) {
this.placeholderRes = placeholderRes;
return this;
}
UIIViewImpl.java 文件源码
项目:RLibrary
阅读 40
收藏 0
点赞 0
评论 0
public int getInteger(@IntegerRes int id) {
return getResources().getInteger(id);
}
TribbbleApp.java 文件源码
项目:tribbble
阅读 39
收藏 0
点赞 0
评论 0
public static int integer(@IntegerRes int resId) {
return sContext.getResources().getInteger(resId);
}
CanDialog.java 文件源码
项目:CanDialog
阅读 41
收藏 0
点赞 0
评论 0
public Builder setIcon(@IntegerRes int resId) {
mDialog.setIcon(resId);
return this;
}
CanDialog.java 文件源码
项目:CanDialog
阅读 105
收藏 0
点赞 0
评论 0
public Builder setFullBackgroundResource(@IntegerRes int rid) {
mDialog.setFullBackgroundResource(rid);
return this;
}
ShareHandler.java 文件源码
项目:xowa_android
阅读 49
收藏 0
点赞 0
评论 0
private int getInteger(@IntegerRes int id) {
return getResources().getInteger(id);
}
SPUtil.java 文件源码
项目:RoseBase
阅读 41
收藏 0
点赞 0
评论 0
@IntegerRes
public static int getInt(Context context, String key, int defaultInt) {
return getSharedPreferences(context).getInt(key, defaultInt);
}
AptoideUtils.java 文件源码
项目:aptoide-client-v8
阅读 49
收藏 0
点赞 0
评论 0
public static int getInt(@IntegerRes int resId, Resources resources) {
return resources.getInteger(resId);
}
Utils.java 文件源码
项目:StraaS-android-sdk-sample
阅读 47
收藏 0
点赞 0
评论 0
public static void fadeOutView(@NonNull final View view, @IntegerRes int durationRes, Animator.AnimatorListener listener) {
fadeOutView(view, durationRes, listener, 0);
}
Utils.java 文件源码
项目:StraaS-android-sdk-sample
阅读 37
收藏 0
点赞 0
评论 0
public static void fadeOutView(@NonNull final View view, @IntegerRes int durationRes, Animator.AnimatorListener listener, long startDelay) {
long duration = view.getResources().getInteger(durationRes);
fadeOutView(view, duration, listener, startDelay);
}
Utils.java 文件源码
项目:StraaS-android-sdk-sample
阅读 43
收藏 0
点赞 0
评论 0
public static void fadeInView(@NonNull final View view, @IntegerRes int durationRes, Animator.AnimatorListener listener) {
long duration = view.getResources().getInteger(durationRes);
fadeInView(view, duration, listener);
}
Home.java 文件源码
项目:Images-to-PDF
阅读 47
收藏 0
点赞 0
评论 0
public int integer(@IntegerRes int resId) {
return getResources().getInteger(resId);
}
BaseUtils.java 文件源码
项目:orz
阅读 38
收藏 0
点赞 0
评论 0
public static int getIntOfRes(Context context, @IntegerRes int res) {
return context.getResources().getInteger(res);
}
SPUtil.java 文件源码
项目:rose
阅读 52
收藏 0
点赞 0
评论 0
@IntegerRes
public static int getInt(Context context, String key, int defaultInt) {
return getSharedPreferences(context).getInt(key, defaultInt);
}
ResourcesUtil.java 文件源码
项目:Android-App-Template
阅读 50
收藏 0
点赞 0
评论 0
public static int getInteger(@IntegerRes int integerRes) {
return ContextUtil.getResources().getInteger(integerRes);
}
EnumResources.java 文件源码
项目:EnumResources
阅读 42
收藏 0
点赞 0
评论 0
public EnumAssociation assocInteger(@IntegerRes final int integerRes) {
_associations.put(INTEGER_FIELD_INDEX, integerRes);
return this;
}