Fixup! Fix stuck when loading preview

This commit is contained in:
tarsin committed 2023-01-15 12:55:05 +08:00
1 parent 87ecaaa6a4
commit bc70824b57
1 file changed
+4 -4
@@ -708,13 +708,13 @@ class GalleryDetailScene : CollapsingToolbarScene(), View.OnClickListener, Downl
viewLifecycleOwner.lifecycleScope.launchIO {
for (i in 0 until previewSet.size()) {
val view = inflater.inflate(R.layout.item_gallery_preview, gridLayout, false)
withUIContext {
gridLayout.addView(view)
}
val image = view.findViewById<LoadImageView>(R.id.image)
previewSet.load(image, gd.gid, i)
image.setTag(R.id.index, i)
image.setOnClickListener(this@GalleryDetailScene)
withUIContext {
gridLayout.addView(view)
image.setOnClickListener(this@GalleryDetailScene)
}
val text = view.findViewById<TextView>(R.id.text)
text.text = (previewSet.getPosition(i) + 1).toString()
}