|
@@ -8,6 +8,7 @@ import android.widget.ImageView;
|
|
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
|
|
|
+import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.bumptech.glide.request.target.SimpleTarget;
|
|
import com.bumptech.glide.request.target.SimpleTarget;
|
|
|
import com.bumptech.glide.request.transition.Transition;
|
|
import com.bumptech.glide.request.transition.Transition;
|
|
@@ -29,10 +30,12 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
public class TemplateAdapter extends CommonAdapter<TemplateBean> {
|
|
public class TemplateAdapter extends CommonAdapter<TemplateBean> {
|
|
|
private List<TemplateBean> mTemplateList;
|
|
private List<TemplateBean> mTemplateList;
|
|
|
|
|
+ //private int mRadius = 8;
|
|
|
|
|
|
|
|
public TemplateAdapter(Context context, int layoutId, List<TemplateBean> templateBeanList) {
|
|
public TemplateAdapter(Context context, int layoutId, List<TemplateBean> templateBeanList) {
|
|
|
super(context, layoutId, templateBeanList);
|
|
super(context, layoutId, templateBeanList);
|
|
|
mTemplateList = templateBeanList;
|
|
mTemplateList = templateBeanList;
|
|
|
|
|
+ //mRadius = (int) context.getResources().getDimension(R.dimen.margin_s);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -41,7 +44,8 @@ public class TemplateAdapter extends CommonAdapter<TemplateBean> {
|
|
|
ImageView iv_template = holder.getView(R.id.iv_template);
|
|
ImageView iv_template = holder.getView(R.id.iv_template);
|
|
|
// 圆角
|
|
// 圆角
|
|
|
Glide.with(mContext).load(templateBean.getCoverUrl())
|
|
Glide.with(mContext).load(templateBean.getCoverUrl())
|
|
|
- //.apply(RequestOptions.bitmapTransform(new RoundedCorners(48))
|
|
|
|
|
|
|
+ //.apply(RequestOptions.bitmapTransform(new RoundedCorners(48)))
|
|
|
|
|
+ //.apply(RequestOptions.bitmapTransform(new RoundedCorners(mRadius)))
|
|
|
.apply(new RequestOptions()
|
|
.apply(new RequestOptions()
|
|
|
.skipMemoryCache(true)
|
|
.skipMemoryCache(true)
|
|
|
.diskCacheStrategy(DiskCacheStrategy.NONE))
|
|
.diskCacheStrategy(DiskCacheStrategy.NONE))
|