From 86d24cb4939cc996dce9f6016b437f1ca9860e6f Mon Sep 17 00:00:00 2001 From: sitou Date: Wed, 24 Sep 2025 13:53:34 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E6=B7=BB?= =?UTF-8?q?=E4=BB=98=E3=81=A7=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E8=A4=87?= =?UTF-8?q?=E6=95=B0=E9=81=B8=E6=8A=9E=E3=81=AE=E3=81=A8=E3=81=8D=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=EF=BC=88=E3=83=87=E3=82=B0=E3=83=AC?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/ui/documentweb/DocumentWebDownload.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt index 1db820a..e4e04b0 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt @@ -162,17 +162,20 @@ class DocumentWebDownloader(private val handlingFragment: Fragment, private val if (filePathCallback == null) return if (resultCode == Activity.RESULT_OK) { - if (data?.data != null) { - // ファイル選択の結果 - val result = WebChromeClient.FileChooserParams.parseResult(resultCode, data) - filePathCallback?.onReceiveValue(result) + val uris: Array? = if (data?.clipData != null) { + // 複数ファイルが選択された場合 + val clipData = data.clipData!! + Array(clipData.itemCount) { i -> clipData.getItemAt(i).uri } + } else if (data?.data != null) { + // 単一ファイルが選択された場合 + arrayOf(data.data!!) } else if (currentPhotoPath != null) { // カメラ撮影の結果 - val uri = Uri.fromFile(File(currentPhotoPath!!)) - filePathCallback?.onReceiveValue(arrayOf(uri)) + arrayOf(Uri.fromFile(File(currentPhotoPath!!))) } else { - filePathCallback?.onReceiveValue(null) + null } + filePathCallback?.onReceiveValue(uris) } else { filePathCallback?.onReceiveValue(null) } -- GitLab