From 183dafc54c6672ce5505cb18b8b173535cd5c9d7 Mon Sep 17 00:00:00 2001 From: Jace <54625750+Jacekun@users.noreply.github.com> Date: Sun, 22 May 2022 17:06:52 +0800 Subject: [PATCH] [Bugfix] Better fullscreen poster resolution. (#1081) --- .../cloudstream3/ui/result/ResultFragment.kt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt index beb546ac..f33141c9 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultFragment.kt @@ -96,6 +96,7 @@ import kotlinx.android.synthetic.main.result_recommendations.* import kotlinx.android.synthetic.main.result_sync.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job +import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import java.io.File @@ -1746,20 +1747,21 @@ class ResultFragment : Fragment(), PanelsChildGestureRegionObserver.GestureRegio result_poster_holder?.setOnClickListener { try { context?.let { ctx -> - val bitmap = result_poster.drawable.toBitmap() - val sourceBuilder = AlertDialog.Builder(ctx) - sourceBuilder.setView(R.layout.result_poster) + runBlocking { + val sourceBuilder = AlertDialog.Builder(ctx) + sourceBuilder.setView(R.layout.result_poster) - val sourceDialog = sourceBuilder.create() - sourceDialog.show() + val sourceDialog = sourceBuilder.create() + sourceDialog.show() - sourceDialog.findViewById(R.id.imgPoster) - ?.apply { - setImageBitmap(bitmap) - setOnClickListener { - sourceDialog.dismissSafe() + sourceDialog.findViewById(R.id.imgPoster) + ?.apply { + setImage(posterImageLink) + setOnClickListener { + sourceDialog.dismissSafe() + } } - } + } } } catch (e: Exception) { logError(e)