Skip to content

Commit

Permalink
feat: 画像の読み込みをキャンセルするように
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Aug 15, 2023
1 parent 8a652dd commit 4acaf29
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package net.pantasystem.milktea.note.timeline

import android.view.LayoutInflater
import android.view.View
import com.bumptech.glide.Glide
import com.google.android.flexbox.FlexboxLayout
import net.pantasystem.milktea.common_android.ui.FontSizeHelper.setMemoFontSpSize
import net.pantasystem.milktea.note.databinding.ItemReactionBinding
Expand All @@ -26,6 +27,7 @@ class ReactionCountItemsFlexboxLayoutBinder(

val child = flexboxLayout.getChildAt(flexboxLayout.childCount - 1)
flexboxLayout.removeViewAt(flexboxLayout.childCount - 1)
Glide.with(child).clear(ItemReactionBinding.bind(child).reactionImage)
viewRecycler.recycleView(child)
}

Expand Down Expand Up @@ -115,10 +117,4 @@ class ViewRecycler<T> where T : View {
}
}

/**
* 現在リサイクル待ちのビューの数を取得する。
*/
fun recycledViewCount(): Int {
return recycledViews.size
}
}

0 comments on commit 4acaf29

Please sign in to comment.