|
|
|
@ -27,6 +27,7 @@ import io.legado.app.lib.theme.primaryTextColor |
|
|
|
|
import io.legado.app.model.CheckSource |
|
|
|
|
import io.legado.app.model.Debug |
|
|
|
|
import io.legado.app.ui.association.ImportBookSourceDialog |
|
|
|
|
import io.legado.app.ui.book.local.rule.TxtTocRuleActivity |
|
|
|
|
import io.legado.app.ui.book.source.debug.BookSourceDebugActivity |
|
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
|
import io.legado.app.ui.document.HandleFileContract |
|
|
|
@ -120,15 +121,13 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
|
when (item.itemId) { |
|
|
|
|
R.id.menu_add_book_source -> startActivity<BookSourceEditActivity>() |
|
|
|
|
R.id.menu_import_qr -> qrResult.launch(null) |
|
|
|
|
R.id.menu_share_source -> viewModel.saveToFile(adapter.selection) { |
|
|
|
|
share(it) |
|
|
|
|
} |
|
|
|
|
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>() |
|
|
|
|
R.id.menu_import_local -> importDoc.launch { |
|
|
|
|
mode = HandleFileContract.FILE |
|
|
|
|
allowExtensions = arrayOf("txt", "json") |
|
|
|
|
} |
|
|
|
|
R.id.menu_import_onLine -> showImportDialog() |
|
|
|
|
R.id.menu_text_toc_rule -> startActivity<TxtTocRuleActivity>() |
|
|
|
|
R.id.menu_sort_manual -> { |
|
|
|
|
item.isChecked = true |
|
|
|
|
sortCheck(Sort.Default) |
|
|
|
@ -338,6 +337,9 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
|
fileData = Triple("bookSource.json", file, "application/json") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
R.id.menu_share_source -> viewModel.saveToFile(adapter.selection) { |
|
|
|
|
share(it) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|