本文整理汇总了Java中android.support.annotation.CheckResult类的典型用法代码示例。如果您正苦于以下问题:Java CheckResult类的具体用法?Java CheckResult怎么用?Java CheckResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckResult类属于android.support.annotation包,在下文中一共展示了CheckResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attributes
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* Optionally you can specify the user attributes
* @param pAttributes The attributes of the user. Can contain only String, char, byte, int, long, float or double values
* @return The Task itself for method chaining
* @throws IllegalArgumentException if the attributes map check fails
*/
@CheckResult @NonNull public RegisterUserTask attributes(@Nullable JSONObject pAttributes) throws IllegalArgumentException {
if(pAttributes != null) {
Iterator<String> keysIterator = pAttributes.keys();
String key;
while(keysIterator.hasNext()) {
Object attr = pAttributes.opt(keysIterator.next());
if( attr != null && (
attr instanceof String ||
attr instanceof Integer ||
attr instanceof Byte ||
attr instanceof Long ||
attr instanceof Double ||
attr instanceof Float ||
attr instanceof Character ||
attr instanceof Boolean)) {
continue;
}
_log("Attributes HashMap can contain only String, char, byte, int, long, float or double values");
throw new IllegalArgumentException("Attributes HashMap can contain only Strings, int, float, long, double or char values");
}
} else {
this.attributes = null;
}
return this;
}
示例2: noTransformation
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see RequestOptions#noTransformation()
*/
@CheckResult
public static GlideOptions noTransformation() {
if (GlideOptions.noTransformation4 == null) {
GlideOptions.noTransformation4 =
new GlideOptions().dontTransform().autoClone();
}
return GlideOptions.noTransformation4;
}
示例3: placeholder
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#placeholder(Drawable)
*/
@CheckResult
public GlideRequest<TranscodeType> placeholder(@Nullable Drawable arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).placeholder(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).placeholder(arg0);
}
return this;
}
示例4: placeholder
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#placeholder(int)
*/
@CheckResult
public GlideRequest<TranscodeType> placeholder(@DrawableRes int arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).placeholder(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).placeholder(arg0);
}
return this;
}
示例5: centerCropTransform
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see RequestOptions#centerCropTransform()
*/
@CheckResult
public static GlideOptions centerCropTransform() {
if (GlideOptions.centerCropTransform3 == null) {
GlideOptions.centerCropTransform3 =
new GlideOptions().centerCrop().autoClone();
}
return GlideOptions.centerCropTransform3;
}
示例6: frame
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#frame(long)
*/
@CheckResult
public GlideRequest<TranscodeType> frame(@IntRange(from = 0) long arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).frame(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).frame(arg0);
}
return this;
}
示例7: search
import android.support.annotation.CheckResult; //导入依赖的package包/类
@CheckResult
Single<Items<VKApiUser>> search(String query, Integer sort, Integer offset, Integer count,
String fields, Integer city, Integer country, String hometown,
Integer universityCountry, Integer university, Integer universityYear,
Integer universityFaculty, Integer universityChair, Integer sex,
Integer status, Integer ageFrom, Integer ageTo, Integer birthDay,
Integer birthMonth, Integer birthYear, Boolean online,
Boolean hasPhoto, Integer schoolCountry, Integer schoolCity,
Integer schoolClass, Integer school, Integer schoolYear,
String religion, String interests, String company,
String position, Integer groupId, String fromList);
示例8: set
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#set(Option<T>, T)
*/
@CheckResult
public <T> GlideRequest<TranscodeType> set(@NonNull Option<T> arg0, @NonNull T arg1) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).set(arg0, arg1);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).set(arg0, arg1);
}
return this;
}
示例9: fitCenter
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#fitCenter()
*/
@CheckResult
public GlideRequest<TranscodeType> fitCenter() {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).fitCenter();
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).fitCenter();
}
return this;
}
示例10: error
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#error(Drawable)
*/
@CheckResult
public GlideRequest<TranscodeType> error(@Nullable Drawable arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).error(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).error(arg0);
}
return this;
}
示例11: custom
import android.support.annotation.CheckResult; //导入依赖的package包/类
@SuppressLint("ShowToast")
@CheckResult
public static Toast custom(@NonNull Context context, @NonNull CharSequence message, Drawable icon,
@ColorInt int tintColor, int duration,
boolean withIcon, boolean shouldTint) {
final Toast currentToast = Toast.makeText(context, null, duration);
final View toastLayout = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.toast_layout, null);
final ImageView toastIcon = toastLayout.findViewById(R.id.toast_icon);
final TextView toastTextView = toastLayout.findViewById(R.id.toast_text);
Drawable drawableFrame;
if (shouldTint)
drawableFrame = ToastyUtils.tint9PatchDrawableFrame(context, tintColor);
else
drawableFrame = ToastyUtils.getDrawable(context, R.drawable.toast_frame);
ToastyUtils.setBackground(toastLayout, drawableFrame);
if (withIcon) {
if (icon == null)
throw new IllegalArgumentException("Avoid passing 'icon' as null if 'withIcon' is set to true");
if (tintIcon)
icon = ToastyUtils.tintIcon(icon, DEFAULT_TEXT_COLOR);
ToastyUtils.setBackground(toastIcon, icon);
} else {
toastIcon.setVisibility(View.GONE);
}
toastTextView.setText(message);
toastTextView.setTextColor(DEFAULT_TEXT_COLOR);
toastTextView.setTypeface(currentTypeface);
toastTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize);
currentToast.setView(toastLayout);
return currentToast;
}
示例12: centerCropTransform
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see RequestOptions#centerCropTransform()
*/
@CheckResult
public static GlideOptions centerCropTransform() {
if (GlideOptions.centerCropTransform2 == null) {
GlideOptions.centerCropTransform2 =
new GlideOptions().centerCrop().autoClone();
}
return GlideOptions.centerCropTransform2;
}
示例13: transforms
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#transforms(Transformation<Bitmap>[])
*/
@CheckResult
@SuppressWarnings({
"unchecked",
"varargs"
})
public GlideRequest<TranscodeType> transforms(@NonNull Transformation<Bitmap>... arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).transforms(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).transforms(arg0);
}
return this;
}
示例14: fallback
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#fallback(int)
*/
@CheckResult
public GlideRequest<TranscodeType> fallback(@DrawableRes int arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).fallback(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).fallback(arg0);
}
return this;
}
示例15: decode
import android.support.annotation.CheckResult; //导入依赖的package包/类
/**
* @see GlideOptions#decode(Class<?>)
*/
@CheckResult
public GlideRequest<TranscodeType> decode(@NonNull Class<?> arg0) {
if (getMutableOptions() instanceof GlideOptions) {
this.requestOptions = ((GlideOptions) getMutableOptions()).decode(arg0);
} else {
this.requestOptions = new GlideOptions().apply(this.requestOptions).decode(arg0);
}
return this;
}