|
|
@@ -60,6 +60,14 @@ public class GlideUtil {
|
|
|
.into(imageView);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static void loadThumbnailImage(String url, final ImageView imageView ,@DrawableRes int placeholder) {
|
|
|
+ Glide.with(ContextUtils.getContext()).load(url).thumbnail(0.3f)
|
|
|
+ .apply(new RequestOptions().placeholder(placeholder)
|
|
|
+ .error(R.drawable.place_holder_failed).diskCacheStrategy(DiskCacheStrategy.RESOURCE))
|
|
|
+ .into(imageView);
|
|
|
+ }
|
|
|
+
|
|
|
public static void preloadThumbnailImage(String url, @DrawableRes int resourceId, final ImageView imageView) {
|
|
|
Glide.with(ContextUtils.getContext()).load(url).thumbnail(0.3f)
|
|
|
.apply(new RequestOptions().placeholder(resourceId)
|
|
|
@@ -111,6 +119,15 @@ public class GlideUtil {
|
|
|
.error(R.drawable.place_holder_failed)).into(imageView);
|
|
|
}
|
|
|
|
|
|
+ public static void loadRoundThumbnailImage(String url, int round ,final ImageView imageView ,@DrawableRes int placeholder) {
|
|
|
+ Glide.with(ContextUtils.getContext()).load(url).thumbnail(0.3f)
|
|
|
+// .apply(RequestOptions.bitmapTransform(new RoundedCorners(DrawableUtils.Dp2Px(round))))
|
|
|
+ .apply(new RequestOptions().placeholder(placeholder)
|
|
|
+ .optionalTransform(new GlideRoundedCornersTransform(DrawableUtil.Dp2Px(round)
|
|
|
+ ,GlideRoundedCornersTransform.CornerType.ALL))
|
|
|
+ .error(R.drawable.place_holder_failed)).into(imageView);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
//加载gif并指定播放次数与获取播放结束监听
|