Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Dec 22, 2023
1 parent e8da0b4 commit 27b8675
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ class GalleryRowHolder(
private fun addImage(row: GalleryRow, index: Int, file: OCFile, size: Pair<Int, Int>) {
val linearLayout = binding.rowLayout[index] as LinearLayout
val thumbnail = linearLayout[0] as ImageView
val (width, height) = size

setMargins(row, index, thumbnail)

val imageUrl = getImageUrl(file)
val placeholder = getPlaceholder(file, size.first, size.second)
val placeholder = getPlaceholder(file, width, height)

Glide
.with(context)
Expand All @@ -178,7 +179,7 @@ class GalleryRowHolder(
.asBitmap()
.fitCenter()
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.override(size.first, size.second)
.override(width, height)
.placeholder(placeholder)
.dontAnimate()
.into(thumbnail)
Expand Down

0 comments on commit 27b8675

Please sign in to comment.