|
@@ -4,7 +4,6 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.screen.main;
|
|
package kr.co.zumo.app.lifeplus.view.screen.main;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
-import android.graphics.Bitmap;
|
|
|
|
|
import android.graphics.Matrix;
|
|
import android.graphics.Matrix;
|
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
import android.support.annotation.Nullable;
|
|
import android.support.annotation.Nullable;
|
|
@@ -18,6 +17,7 @@ import android.widget.TextView;
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.load.DataSource;
|
|
import com.bumptech.glide.load.DataSource;
|
|
|
import com.bumptech.glide.load.engine.GlideException;
|
|
import com.bumptech.glide.load.engine.GlideException;
|
|
|
|
|
+import com.bumptech.glide.load.resource.gif.GifDrawable;
|
|
|
import com.bumptech.glide.request.RequestListener;
|
|
import com.bumptech.glide.request.RequestListener;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.bumptech.glide.request.target.Target;
|
|
import com.bumptech.glide.request.target.Target;
|
|
@@ -346,23 +346,23 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
|
|
|
imageWidth = Math.max(maskWidth + ResourceUtil.dpToPx(50), screenWidth - ResourceUtil.dpToPx(50));
|
|
imageWidth = Math.max(maskWidth + ResourceUtil.dpToPx(50), screenWidth - ResourceUtil.dpToPx(50));
|
|
|
imageHeight = maskHeight + ResourceUtil.dpToPx(50);
|
|
imageHeight = maskHeight + ResourceUtil.dpToPx(50);
|
|
|
Glide.with(imageView)
|
|
Glide.with(imageView)
|
|
|
- .asBitmap()
|
|
|
|
|
|
|
+ .asGif()
|
|
|
.load(url)
|
|
.load(url)
|
|
|
// .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE))
|
|
// .apply(new RequestOptions().diskCacheStrategy(DiskCacheStrategy.NONE))
|
|
|
// .apply(new RequestOptions().skipMemoryCache(true))
|
|
// .apply(new RequestOptions().skipMemoryCache(true))
|
|
|
.apply(new RequestOptions().centerCrop())
|
|
.apply(new RequestOptions().centerCrop())
|
|
|
.apply(new RequestOptions().placeholder((ResourceUtil.getDrawable(imageView.getContext(), R.drawable.image_loading_main))))
|
|
.apply(new RequestOptions().placeholder((ResourceUtil.getDrawable(imageView.getContext(), R.drawable.image_loading_main))))
|
|
|
.apply(new RequestOptions().override(/*maskWidth + ResourceUtil.dpToPx(200)*/ imageWidth, imageHeight))
|
|
.apply(new RequestOptions().override(/*maskWidth + ResourceUtil.dpToPx(200)*/ imageWidth, imageHeight))
|
|
|
- .listener(new RequestListener<Bitmap>() {
|
|
|
|
|
|
|
+ .listener(new RequestListener<GifDrawable>() {
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
|
|
|
|
|
|
|
+ public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<GifDrawable> target, boolean isFirstResource) {
|
|
|
imageWidth = maskWidth;
|
|
imageWidth = maskWidth;
|
|
|
imageHeight = maskHeight;
|
|
imageHeight = maskHeight;
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
|
|
|
|
|
|
|
+ public boolean onResourceReady(GifDrawable resource, Object model, Target<GifDrawable> target, DataSource dataSource, boolean isFirstResource) {
|
|
|
Visibler.visible(mask0, mask1, mask2);
|
|
Visibler.visible(mask0, mask1, mask2);
|
|
|
//you should call after the bitmap drawn
|
|
//you should call after the bitmap drawn
|
|
|
// int imageLoadedWidth = resource.getWidth(); //this is the bitmap's width
|
|
// int imageLoadedWidth = resource.getWidth(); //this is the bitmap's width
|