pass Glide the activity instead of context

This commit is contained in:
tibbi 2016-11-20 13:49:13 +01:00
parent ca944c37a4
commit ff9b61f95e

View file

@ -217,10 +217,10 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
val tmb = directory.thumbnail
val timestampSignature = StringSignature(directory.timestamp.toString())
if (tmb.endsWith(".gif")) {
Glide.with(activity.applicationContext).load(tmb).asGif().diskCacheStrategy(DiskCacheStrategy.NONE).signature(timestampSignature)
Glide.with(activity).load(tmb).asGif().diskCacheStrategy(DiskCacheStrategy.NONE).signature(timestampSignature)
.placeholder(R.color.tmb_background).centerCrop().crossFade().into(itemView.dir_thumbnail)
} else {
Glide.with(activity.applicationContext).load(tmb).diskCacheStrategy(DiskCacheStrategy.RESULT).signature(timestampSignature)
Glide.with(activity).load(tmb).diskCacheStrategy(DiskCacheStrategy.RESULT).signature(timestampSignature)
.placeholder(R.color.tmb_background).centerCrop().crossFade().into(itemView.dir_thumbnail)
}