Small Performance Improvement

This commit is contained in:
Bnyro 2022-05-09 17:15:32 +02:00
parent 6ed2fabd27
commit 28e8533f65
2 changed files with 4 additions and 5 deletions

View File

@ -247,10 +247,9 @@ class PlayerFragment : Fragment() {
commentsRecView = view.findViewById(R.id.comments_recView)
commentsRecView.layoutManager = LinearLayoutManager(view.context)
commentsRecView.setItemViewCacheSize(20);
commentsRecView.setDrawingCacheEnabled(true);
commentsRecView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
commentsRecView.setItemViewCacheSize(20)
commentsRecView.setDrawingCacheEnabled(true)
commentsRecView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH)
relatedRecView = view.findViewById(R.id.player_recView)
relatedRecView.layoutManager =

View File

@ -28,7 +28,7 @@ class CommentsAdapter(private val comments: MutableList<Comment>): RecyclerView
holder.v.findViewById<TextView>(R.id.comment_infos).text = comments[position].author.toString() + "" + comments[position].commentedTime.toString()
holder.v.findViewById<TextView>(R.id.comment_text).text = comments[position].commentText.toString()
val thumbnailImage = holder.v.findViewById<ImageView>(R.id.commentor_image)
Picasso.get().load(comments[position].thumbnail).resize(50,50).centerCrop().into(thumbnailImage)
Picasso.get().load(comments[position].thumbnail).fit().centerCrop().into(thumbnailImage)
holder.v.findViewById<TextView>(R.id.likes_textView).text = comments[position].likeCount?.toLong().formatShort()
if (comments[position].verified == true) {
holder.v.findViewById<ImageView>(R.id.verified_imageView).visibility = View.VISIBLE