pull/1434/head
gedoor 3 years ago
parent ba69ae317b
commit 17e1ece0f6
  1. 8
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  2. 20
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt
  3. 10
      app/src/main/res/menu/book_source.xml
  4. 5
      app/src/main/res/menu/book_source_sel.xml
  5. 12
      app/src/main/res/menu/rss_source.xml
  6. 7
      app/src/main/res/menu/rss_source_sel.xml

@ -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
}

@ -116,9 +116,6 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
R.id.menu_import_onLine -> showImportDialog()
R.id.menu_import_qr -> qrCodeResult.launch(null)
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>()
R.id.menu_share_source -> viewModel.saveToFile(adapter.selection) {
share(it)
}
R.id.menu_import_default -> viewModel.importDefault()
R.id.menu_help -> showHelp()
else -> if (item.groupId == R.id.source_group) {
@ -134,16 +131,17 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
R.id.menu_enable_selection -> viewModel.enableSelection(adapter.selection)
R.id.menu_disable_selection -> viewModel.disableSelection(adapter.selection)
R.id.menu_del_selection -> viewModel.delSelection(adapter.selection)
R.id.menu_export_selection -> exportResult.launch {
mode = HandleFileContract.EXPORT
fileData = Triple(
"exportRssSource.json",
GSON.toJson(adapter.selection).toByteArray(),
"application/json"
)
}
R.id.menu_top_sel -> viewModel.topSource(*adapter.selection.toTypedArray())
R.id.menu_bottom_sel -> viewModel.bottomSource(*adapter.selection.toTypedArray())
R.id.menu_export_selection -> viewModel.saveToFile(adapter.selection) { file ->
exportResult.launch {
mode = HandleFileContract.EXPORT
fileData = Triple("exportRssSource.json", file, "application/json")
}
}
R.id.menu_share_source -> viewModel.saveToFile(adapter.selection) {
share(it)
}
}
return true
}

@ -89,37 +89,31 @@
<item
android:id="@+id/menu_add_book_source"
android:icon="@drawable/ic_add"
android:title="@string/add_book_source"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_local"
android:icon="@drawable/ic_import"
android:title="@string/import_local"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_onLine"
android:icon="@drawable/ic_import"
android:title="@string/import_on_line"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_qr"
android:icon="@drawable/ic_import"
android:title="@string/import_by_qr_code"
app:showAsAction="never" />
<item
android:id="@+id/menu_share_source"
android:icon="@drawable/ic_share"
android:title="@string/share_selected_source"
android:id="@+id/menu_text_toc_rule"
android:title="@string/txt_toc_regex"
app:showAsAction="never" />
<item
android:id="@+id/menu_help"
android:icon="@drawable/ic_help"
android:title="@string/help"
app:showAsAction="never" />

@ -47,6 +47,11 @@
android:title="@string/export_selection"
app:showAsAction="never" />
<item
android:id="@+id/menu_share_source"
android:title="@string/share_selected_source"
app:showAsAction="never" />
<item
android:id="@+id/menu_check_source"
android:icon="@drawable/ic_check_source"

@ -26,43 +26,31 @@
<item
android:id="@+id/menu_add"
android:icon="@drawable/ic_add"
android:title="@string/add_rss_source"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_local"
android:icon="@drawable/ic_import"
android:title="@string/import_local"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_onLine"
android:icon="@drawable/ic_import"
android:title="@string/import_on_line"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_qr"
android:icon="@drawable/ic_import"
android:title="@string/import_by_qr_code"
app:showAsAction="never" />
<item
android:id="@+id/menu_import_default"
android:icon="@drawable/ic_import"
android:title="@string/import_default_rule"
app:showAsAction="never" />
<item
android:id="@+id/menu_share_source"
android:icon="@drawable/ic_share"
android:title="@string/share_selected_source"
app:showAsAction="never" />
<item
android:id="@+id/menu_help"
android:icon="@drawable/ic_help"
android:title="@string/help"
app:showAsAction="never" />

@ -27,4 +27,11 @@
android:title="@string/export_selection"
app:showAsAction="never" />
<item
android:id="@+id/menu_share_source"
android:title="@string/share_selected_source"
app:showAsAction="never" />
</menu>

Loading…
Cancel
Save