From 98bb0b8f14081773630929f7b18cc8bd7c9b614c Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 27 Nov 2021 19:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/local/ImportBookActivity.kt | 12 ++++++------ .../io/legado/app/utils/ActivityResultContracts.kt | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index d2c68cbfe..78686fe19 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -72,7 +72,7 @@ class ImportBookActivity : VMBaseActivity selectFolder.launch { } + R.id.menu_select_folder -> selectFolder.launch() R.id.menu_scan_folder -> scanFolder() R.id.menu_import_file_name -> alertImportFileName() } @@ -133,7 +133,7 @@ class ImportBookActivity : VMBaseActivity { binding.tvEmptyMsg.visible() - selectFolder.launch { } + selectFolder.launch() } lastPath.isContentScheme() -> { val rootUri = Uri.parse(lastPath) @@ -141,7 +141,7 @@ class ImportBookActivity : VMBaseActivity Build.VERSION_CODES.Q -> { binding.tvEmptyMsg.visible() - selectFolder.launch { } + selectFolder.launch() } else -> initRootPath(lastPath) } @@ -172,7 +172,7 @@ class ImportBookActivity : VMBaseActivity.launch() { + launch(null) +} + class SelectImageContract : ActivityResultContract() { var requestCode: Int? = null