微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.support.annotation.CheckResult的实例源码

项目:Customerly-Android-SDK    文件Customerly.java   
/**
 * 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,float or double values");
            throw new IllegalArgumentException("Attributes HashMap can contain only Strings,float,double or char values");
        }
    } else {
        this.attributes = null;
    }
    return this;
}
项目:GitHub    文件GlideOptions.java   
/**
 * @see RequestOptions#noTransformation()
 */
@CheckResult
public static GlideOptions noTransformation() {
  if (GlideOptions.noTransformation4 == null) {
    GlideOptions.noTransformation4 =
        new GlideOptions().dontTransform().autoClone();
  }
  return GlideOptions.noTransformation4;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideOptions.java   
/**
 * @see RequestOptions#centerCropTransform()
 */
@CheckResult
public static GlideOptions centerCropTransform() {
  if (GlideOptions.centerCropTransform3 == null) {
    GlideOptions.centerCropTransform3 =
        new GlideOptions().centerCrop().autoClone();
  }
  return GlideOptions.centerCropTransform3;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:Phoenix-for-VK    文件IUsersApi.java   
@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);
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:Toasty    文件Toasty.java   
@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;
}
项目:GitHub    文件GlideOptions.java   
/**
 * @see RequestOptions#centerCropTransform()
 */
@CheckResult
public static GlideOptions centerCropTransform() {
  if (GlideOptions.centerCropTransform2 == null) {
    GlideOptions.centerCropTransform2 =
        new GlideOptions().centerCrop().autoClone();
  }
  return GlideOptions.centerCropTransform2;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @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;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#optionalCenterCrop()
 */
@CheckResult
public GlideRequest<TranscodeType> optionalCenterCrop() {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).optionalCenterCrop();
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).optionalCenterCrop();
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#dontTransform()
 */
@CheckResult
public GlideRequest<TranscodeType> dontTransform() {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).dontTransform();
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).dontTransform();
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#fallback(Drawable)
 */
@CheckResult
public GlideRequest<TranscodeType> fallback(@Nullable Drawable arg0) {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).fallback(arg0);
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).fallback(arg0);
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#centerInside()
 */
@CheckResult
public GlideRequest<TranscodeType> centerInside() {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).centerInside();
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).centerInside();
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#useAnimationPool(boolean)
 */
@CheckResult
public GlideRequest<TranscodeType> useAnimationPool(boolean flag) {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).useAnimationPool(flag);
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).useAnimationPool(flag);
  }
  return this;
}
项目:GitHub    文件GlideOptions.java   
/**
 * @see RequestOptions#fitCenterTransform()
 */
@CheckResult
public static GlideOptions fitCenterTransform() {
  if (GlideOptions.fitCenterTransform0 == null) {
    GlideOptions.fitCenterTransform0 =
        new GlideOptions().fitCenter().autoClone();
  }
  return GlideOptions.fitCenterTransform0;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#downsample(DownsampleStrategy)
 */
@CheckResult
public GlideRequest<TranscodeType> downsample(@NonNull DownsampleStrategy arg0) {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).downsample(arg0);
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).downsample(arg0);
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#disallowHardwareConfig()
 */
@CheckResult
public GlideRequest<TranscodeType> disallowHardwareConfig() {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).disallowHardwareConfig();
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).disallowHardwareConfig();
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#optionalCircleCrop()
 */
@CheckResult
public GlideRequest<TranscodeType> optionalCircleCrop() {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).optionalCircleCrop();
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).optionalCircleCrop();
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#sizeMultiplier(float)
 */
@CheckResult
public GlideRequest<TranscodeType> sizeMultiplier(@FloatRange(from = 0.0,to = 1.0) float arg0) {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).sizeMultiplier(arg0);
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).sizeMultiplier(arg0);
  }
  return this;
}
项目:GitHub    文件GlideRequest.java   
/**
 * @see GlideOptions#encodeQuality(int)
 */
@CheckResult
public GlideRequest<TranscodeType> encodeQuality(@IntRange(from = 0,to = 100) int arg0) {
  if (getMutableOptions() instanceof GlideOptions) {
    this.requestOptions = ((GlideOptions) getMutableOptions()).encodeQuality(arg0);
  } else {
    this.requestOptions = new GlideOptions().apply(this.requestOptions).encodeQuality(arg0);
  }
  return this;
}
项目:Phoenix-for-VK    文件ITopicsstore.java   
@CheckResult
Completable attachPoll(int accountId,int ownerId,int topicId,PollEntity pollDbo);
项目:GitHub    文件GlideOptions.java   
@Override
@CheckResult
public final GlideOptions transform(@NonNull Transformation<Bitmap> arg0) {
  return (GlideOptions) super.transform(arg0);
}
项目:GitHub    文件GlideOptions.java   
@Override
@CheckResult
public final GlideOptions dontTransform() {
  return (GlideOptions) super.dontTransform();
}
项目:Toasty    文件Toasty.java   
@CheckResult
public static Toast warning(@NonNull Context context,@NonNull CharSequence message) {
    return warning(context,message,Toast.LENGTH_SHORT,true);
}
项目:Utils    文件ToastUtil.java   
@CheckResult
public static Toast error(@NonNull Context context,@NonNull String message,int duration) {
    return error(context,duration,true);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。