Skip to content

Commit 2e59b85

Browse files
committed
shrink images
1 parent 8387e35 commit 2e59b85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/bks/mvisample/ui/main/BlogPostsAdapter.kt

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.DiffUtil
99
import com.bks.mvisample.R
1010
import com.bks.mvisample.models.BlogPost
1111
import com.bumptech.glide.Glide
12+
import com.bumptech.glide.request.RequestOptions
1213
import kotlinx.android.synthetic.main.fragment_main.view.*
1314
import kotlinx.android.synthetic.main.layout_blog_list_item.view.*
1415

@@ -69,7 +70,12 @@ class BlogPostsAdapter(private val interaction: Interaction? = null) :
6970
}
7071

7172
itemView.blog_title.text = item.title
73+
74+
// need to shrink images b/c they are very high resolution
75+
val requestOptions = RequestOptions
76+
.overrideOf(1920, 1080)
7277
Glide.with(itemView.context)
78+
.applyDefaultRequestOptions(requestOptions)
7379
.load(item.image)
7480
.into(itemView.blog_image)
7581
}

0 commit comments

Comments
 (0)