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

Customerly.java 文件源码 项目:Customerly-Android-SDK 阅读 40 收藏 0 点赞 0 评论 0
/**
 * 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;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#noTransformation()
 */
@CheckResult
public static GlideOptions noTransformation() {
  if (GlideOptions.noTransformation4 == null) {
    GlideOptions.noTransformation4 =
        new GlideOptions().dontTransform().autoClone();
  }
  return GlideOptions.noTransformation4;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 42 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 43 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#noTransformation()
 */
@CheckResult
public static GlideOptions noTransformation() {
  if (GlideOptions.noTransformation4 == null) {
    GlideOptions.noTransformation4 =
        new GlideOptions().dontTransform().autoClone();
  }
  return GlideOptions.noTransformation4;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 39 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 51 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#centerCropTransform()
 */
@CheckResult
public static GlideOptions centerCropTransform() {
  if (GlideOptions.centerCropTransform3 == null) {
    GlideOptions.centerCropTransform3 =
        new GlideOptions().centerCrop().autoClone();
  }
  return GlideOptions.centerCropTransform3;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 38 收藏 0 点赞 0 评论 0
/**
 * @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;
}
IUsersApi.java 文件源码 项目:Phoenix-for-VK 阅读 34 收藏 0 点赞 0 评论 0
@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);
GlideRequest.java 文件源码 项目:GitHub 阅读 33 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 36 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 47 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 40 收藏 0 点赞 0 评论 0
/**
 * @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.java 文件源码 项目:Toasty 阅读 36 收藏 0 点赞 0 评论 0
@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;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 36 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#centerCropTransform()
 */
@CheckResult
public static GlideOptions centerCropTransform() {
  if (GlideOptions.centerCropTransform2 == null) {
    GlideOptions.centerCropTransform2 =
        new GlideOptions().centerCrop().autoClone();
  }
  return GlideOptions.centerCropTransform2;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 34 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 40 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 36 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 38 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 31 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 35 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 32 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 37 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 41 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#noTransformation()
 */
@CheckResult
public static GlideOptions noTransformation() {
  if (GlideOptions.noTransformation4 == null) {
    GlideOptions.noTransformation4 =
        new GlideOptions().dontTransform().autoClone();
  }
  return GlideOptions.noTransformation4;
}
GlideOptions.java 文件源码 项目:GitHub 阅读 38 收藏 0 点赞 0 评论 0
/**
 * @see RequestOptions#fitCenterTransform()
 */
@CheckResult
public static GlideOptions fitCenterTransform() {
  if (GlideOptions.fitCenterTransform0 == null) {
    GlideOptions.fitCenterTransform0 =
        new GlideOptions().fitCenter().autoClone();
  }
  return GlideOptions.fitCenterTransform0;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 46 收藏 0 点赞 0 评论 0
/**
 * @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;
}
GlideRequest.java 文件源码 项目:GitHub 阅读 39 收藏 0 点赞 0 评论 0
/**
 * @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;
}


问题


面经


文章

微信
公众号

扫码关注公众号