From aab5a5689250d44913ac3fe2f1a50a3af95b1296 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sun, 14 Aug 2022 00:25:48 +0700 Subject: [PATCH] MangaFullCoverDialog: Use the new image picker when available (#7740) --- .../tachiyomi/ui/manga/info/MangaFullCoverDialog.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt index 24f34aa331..8c7aac3801 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaFullCoverDialog.kt @@ -6,6 +6,8 @@ import android.content.Intent import android.graphics.drawable.BitmapDrawable import android.net.Uri import android.os.Bundle +import androidx.activity.result.PickVisualMediaRequest +import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.remember @@ -112,14 +114,8 @@ class MangaFullCoverDialog : FullComposeController { - val intent = Intent(Intent.ACTION_GET_CONTENT).apply { - type = "image/*" - } startActivityForResult( - Intent.createChooser( - intent, - resources?.getString(R.string.file_select_cover), - ), + PickVisualMedia().createIntent(activity!!, PickVisualMediaRequest(PickVisualMedia.ImageOnly)), REQUEST_IMAGE_OPEN, ) }