|
@@ -32,22 +32,6 @@ public class ImgUtil {
|
|
|
.into(img);
|
|
.into(img);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void loadImgFace(Context context, String face_url, final ImageView img) {
|
|
|
|
|
- RequestOptions options = new RequestOptions()
|
|
|
|
|
- .placeholder(R.mipmap.icon_place_holder)
|
|
|
|
|
- .error(R.mipmap.icon_place_holder)
|
|
|
|
|
- .fitCenter()
|
|
|
|
|
- .diskCacheStrategy(DiskCacheStrategy.NONE);
|
|
|
|
|
- Glide.with(context)
|
|
|
|
|
- .load(face_url)
|
|
|
|
|
- .into(new SimpleTarget<Drawable>() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
|
|
|
|
- img.setImageDrawable(resource);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public static void loadImgCircle(Context context, String imgUrl, ImageView img, int dPlaceHolder, int dError) {
|
|
public static void loadImgCircle(Context context, String imgUrl, ImageView img, int dPlaceHolder, int dError) {
|
|
|
RequestOptions options = new RequestOptions()
|
|
RequestOptions options = new RequestOptions()
|
|
|
.placeholder(dPlaceHolder)
|
|
.placeholder(dPlaceHolder)
|
|
@@ -68,20 +52,6 @@ public class ImgUtil {
|
|
|
Glide.with(context).load(imgUrl).apply(options).into(img);
|
|
Glide.with(context).load(imgUrl).apply(options).into(img);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void loadAvatarRound(Context context, String imgUrl, ImageView img) {
|
|
|
|
|
- RequestOptions options = new RequestOptions()
|
|
|
|
|
- .placeholder(R.mipmap.icon_place_holder)
|
|
|
|
|
- .error(R.mipmap.icon_place_holder)
|
|
|
|
|
- .transform(new CenterCrop(), new GlideRoundTransform(context, 5))
|
|
|
|
|
- .diskCacheStrategy(DiskCacheStrategy.ALL);
|
|
|
|
|
-
|
|
|
|
|
- Glide.with(context).load(imgUrl).apply(options).into(img);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void loadImgCircle(Context context, String imgUrl, ImageView img) {
|
|
|
|
|
- loadImgCircle(context, imgUrl, img, R.mipmap.icon_place_holder, R.mipmap.icon_place_holder);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @param: [context, imgUrl, img]
|
|
* @param: [context, imgUrl, img]
|
|
|
* @return: void
|
|
* @return: void
|
|
@@ -97,19 +67,11 @@ public class ImgUtil {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void loadImg(Context context, String imgUrl, ImageView img) {
|
|
public static void loadImg(Context context, String imgUrl, ImageView img) {
|
|
|
- loadImgPlaceHolderError(context, imgUrl, img, R.mipmap.icon_place_holder, R.mipmap.icon_place_holder);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static void loadImgNoPlaceHolder(Context context, String imgUrl, ImageView img) {
|
|
|
|
|
RequestOptions options = new RequestOptions()
|
|
RequestOptions options = new RequestOptions()
|
|
|
.diskCacheStrategy(DiskCacheStrategy.ALL);
|
|
.diskCacheStrategy(DiskCacheStrategy.ALL);
|
|
|
Glide.with(context).load(imgUrl).apply(options).into(img);
|
|
Glide.with(context).load(imgUrl).apply(options).into(img);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void loadGifImg(Context context, int imgUrl, ImageView img) {
|
|
|
|
|
- Glide.with(context).asGif().load(imgUrl).into(img);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public static void zoomImg(Context context, String imgUrl, ImageView img) {
|
|
public static void zoomImg(Context context, String imgUrl, ImageView img) {
|
|
|
Glide.with(context)
|
|
Glide.with(context)
|
|
|
.asBitmap()
|
|
.asBitmap()
|
|
@@ -163,7 +125,9 @@ public class ImgUtil {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void loadRoundImg(Context context, String imgUrl, ImageView img) {
|
|
public static void loadRoundImg(Context context, String imgUrl, ImageView img) {
|
|
|
- loadRoundImg(context, imgUrl, img, R.mipmap.icon_place_holder, R.mipmap.icon_place_holder);
|
|
|
|
|
|
|
+ RequestOptions options = new RequestOptions()
|
|
|
|
|
+ .diskCacheStrategy(DiskCacheStrategy.ALL);
|
|
|
|
|
+ Glide.with(context).load(imgUrl).transform(new GlideRoundTransform(context, 5)).apply(options).into(img);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void loadBitmap(Context context, Bitmap bitmap, ImageView imageView) {
|
|
public static void loadBitmap(Context context, Bitmap bitmap, ImageView imageView) {
|