var options: RequestOptions? = null
if (options == null) { options = RequestOptions() .transform(CenterCrop(), RoundedCorners(dp2px(8f))) }
Glide.with(helper.itemView.context).load(item.logo) .thumbnail(loadTransform(ivhead.context,R.mipmap.logo_new_quadrate)) .thumbnail(loadTransform(ivhead.context,R.mipmap.logo_new_quadrate)) .apply(options!!).into(ivhead)
private fun loadTransform( context: Context, @DrawableRes placeholderId: Int ): RequestBuilder<Drawable?>? { return Glide.with(context) .load(placeholderId) .apply( options!! ) }
亲测可用