From 26bcef1cc0cdd94d5730e9a7364c5a69e7b9160c Mon Sep 17 00:00:00 2001 From: tom5079 Date: Sat, 13 Feb 2021 17:51:18 +0900 Subject: [PATCH] Fixed Related gallery not showing up on GalleryDialog --- .../main/java/xyz/quaver/pupil/ui/dialog/GalleryDialog.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/xyz/quaver/pupil/ui/dialog/GalleryDialog.kt b/app/src/main/java/xyz/quaver/pupil/ui/dialog/GalleryDialog.kt index 693c208d..c12b7677 100644 --- a/app/src/main/java/xyz/quaver/pupil/ui/dialog/GalleryDialog.kt +++ b/app/src/main/java/xyz/quaver/pupil/ui/dialog/GalleryDialog.kt @@ -203,7 +203,7 @@ class GalleryDialog(context: Context, private val galleryID: Int) : AlertDialog( } private fun addRelated(gallery: Gallery) { - val galleries = ArrayList() + val galleries = mutableListOf() val adapter = GalleryBlockAdapter(galleries).apply { onChipClickedHandler.add { tag -> @@ -216,7 +216,7 @@ class GalleryDialog(context: Context, private val galleryID: Int) : AlertDialog( GalleryDialogDetailsBinding.inflate(layoutInflater, binding.contents, true).apply { type.setText(R.string.gallery_related) - RecyclerView(context).apply { + contents.addView(RecyclerView(context).apply { layoutManager = LinearLayoutManager(context) this.adapter = adapter @@ -236,7 +236,7 @@ class GalleryDialog(context: Context, private val galleryID: Int) : AlertDialog( true } } - } + }) CoroutineScope(Dispatchers.IO).launch { gallery.related.forEach { galleryID ->