Skip to content

Instantly share code, notes, and snippets.

@illuzor
Last active September 22, 2018 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illuzor/3b33fe362572230444d49ba5d7e7e1c9 to your computer and use it in GitHub Desktop.
Save illuzor/3b33fe362572230444d49ba5d7e7e1c9 to your computer and use it in GitHub Desktop.
package com.illuzor.lesson.wallpapers.adapters
import android.view.View
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.illuzor.lesson.wallpapers.GlideApp
import com.illuzor.lesson.wallpapers.R
class GalleryViewHolder(view: View) : RecyclerView.ViewHolder(view) {
private val ivPreview: ImageView = view.findViewById(R.id.iv_preview)
fun loadImage(url: String) =
GlideApp.with(itemView)
.load(url)
.placeholder(R.drawable.placeholder)
.transition(DrawableTransitionOptions.withCrossFade())
.into(ivPreview)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment