pull/1463/head^2 3.21.112719
gedoor 3 years ago
parent 98bb0b8f14
commit 5c42cc0c77
  1. 2
      app/src/main/java/io/legado/app/ui/book/group/GroupEditDialog.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/info/edit/BookInfoEditActivity.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  4. 3
      app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  6. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  7. 14
      app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt
  8. 3
      app/src/main/java/io/legado/app/ui/document/HandleFileActivity.kt
  9. 3
      app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt
  10. 2
      app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt
  11. 2
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt
  12. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt

@ -55,7 +55,7 @@ class GroupEditDialog() : BaseDialogFragment(R.layout.dialog_book_group_edit) {
}
binding.run {
ivCover.onClick {
selectImage.launch(null)
selectImage.launch()
}
btnCancel.onClick {
dismiss()

@ -58,7 +58,7 @@ class BookInfoEditActivity :
}
}
tvSelectCover.setOnClickListener {
selectCover.launch(null)
selectCover.launch()
}
tvRefreshCover.setOnClickListener {
viewModel.book?.customCoverUrl = tieCoverUrl.text?.toString()

@ -117,7 +117,7 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) {
ivBg.setImageResource(R.drawable.ic_image)
ivBg.setColorFilter(primaryTextColor)
root.setOnClickListener {
selectBgImage.launch(null)
selectBgImage.launch()
}
}
}

@ -14,6 +14,7 @@ import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.qrcode.QrCodeResult
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.launch
import io.legado.app.utils.setEdgeEffectColor
import io.legado.app.utils.showDialogFragment
import io.legado.app.utils.toastOnUi
@ -137,7 +138,7 @@ class BookSourceDebugActivity : VMBaseActivity<ActivitySourceDebugBinding, BookS
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.menu_scan -> qrCodeResult.launch(null)
R.id.menu_scan -> qrCodeResult.launch()
R.id.menu_search_src -> showDialogFragment(TextDialog(viewModel.searchSrc))
R.id.menu_book_src -> showDialogFragment(TextDialog(viewModel.bookSrc))
R.id.menu_toc_src -> showDialogFragment(TextDialog(viewModel.tocSrc))

@ -112,7 +112,7 @@ class BookSourceEditActivity :
}
R.id.menu_copy_source -> sendToClip(GSON.toJson(getSource()))
R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) }
R.id.menu_qr_code_camera -> qrCodeResult.launch(null)
R.id.menu_qr_code_camera -> qrCodeResult.launch()
R.id.menu_share_str -> share(GSON.toJson(getSource()))
R.id.menu_share_qr -> shareWithQr(
GSON.toJson(getSource()),

@ -120,7 +120,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.menu_add_book_source -> startActivity<BookSourceEditActivity>()
R.id.menu_import_qr -> qrResult.launch(null)
R.id.menu_import_qr -> qrResult.launch()
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>()
R.id.menu_import_local -> importDoc.launch {
mode = HandleFileContract.FILE

@ -123,7 +123,7 @@ class BackupConfigFragment : BasePreferenceFragment(),
upPreferenceSummary(PreferKey.webDavPassword, getPrefString(PreferKey.webDavPassword))
upPreferenceSummary(PreferKey.backupPath, getPrefString(PreferKey.backupPath))
findPreference<io.legado.app.ui.widget.prefs.Preference>("web_dav_restore")
?.onLongClick = { restoreDir.launch(null) }
?.onLongClick = { restoreDir.launch() }
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -206,11 +206,11 @@ class BackupConfigFragment : BasePreferenceFragment(),
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
when (preference?.key) {
PreferKey.backupPath -> selectBackupPath.launch(null)
PreferKey.backupPath -> selectBackupPath.launch()
PreferKey.restoreIgnore -> restoreIgnore()
"web_dav_backup" -> backup()
"web_dav_restore" -> restore()
"import_old" -> restoreOld.launch(null)
"import_old" -> restoreOld.launch()
}
return super.onPreferenceTreeClick(preference)
}
@ -234,7 +234,7 @@ class BackupConfigFragment : BasePreferenceFragment(),
fun backup() {
val backupPath = AppConfig.backupPath
if (backupPath.isNullOrEmpty()) {
backupDir.launch(null)
backupDir.launch()
} else {
if (backupPath.isContentScheme()) {
val uri = Uri.parse(backupPath)
@ -249,7 +249,7 @@ class BackupConfigFragment : BasePreferenceFragment(),
appCtx.toastOnUi(getString(R.string.backup_fail, it.localizedMessage))
}
} else {
backupDir.launch(null)
backupDir.launch()
}
} else {
backupUsePermission(backupPath)
@ -301,13 +301,13 @@ class BackupConfigFragment : BasePreferenceFragment(),
Restore.restore(requireContext(), backupPath)
}
} else {
restoreDir.launch(null)
restoreDir.launch()
}
} else {
restoreUsePermission(backupPath)
}
} else {
restoreDir.launch(null)
restoreDir.launch()
}
}

@ -18,6 +18,7 @@ import io.legado.app.lib.permission.Permissions
import io.legado.app.lib.permission.PermissionsCompat
import io.legado.app.utils.getJsonArray
import io.legado.app.utils.isContentScheme
import io.legado.app.utils.launch
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
import java.io.File
@ -80,7 +81,7 @@ class HandleFileActivity :
items(selectList) { _, item, _ ->
when (item.value) {
HandleFileContract.DIR -> kotlin.runCatching {
selectDocTree.launch(null)
selectDocTree.launch()
}.onFailure {
toastOnUi(R.string.open_sys_dir_picker_error)
checkPermissions {

@ -12,6 +12,7 @@ import io.legado.app.base.BaseActivity
import io.legado.app.databinding.ActivityQrcodeCaptureBinding
import io.legado.app.utils.QRCodeUtils
import io.legado.app.utils.SelectImageContract
import io.legado.app.utils.launch
import io.legado.app.utils.readBytes
import io.legado.app.utils.viewbindingdelegate.viewBinding
@ -41,7 +42,7 @@ class QrCodeActivity : BaseActivity<ActivityQrcodeCaptureBinding>(), OnScanResul
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_choose_from_gallery -> selectQrImage.launch(null)
R.id.action_choose_from_gallery -> selectQrImage.launch()
}
return super.onCompatOptionsItemSelected(item)
}

@ -224,7 +224,7 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
mode = HandleFileContract.FILE
allowExtensions = arrayOf("txt", "json")
}
R.id.menu_import_qr -> qrCodeResult.launch(null)
R.id.menu_import_qr -> qrCodeResult.launch()
R.id.menu_help -> showHelp()
else -> if (item.groupId == R.id.replace_group) {
searchView.setQuery("group:${item.title}", true)

@ -125,7 +125,7 @@ class RssSourceEditActivity :
}
}
R.id.menu_copy_source -> sendToClip(GSON.toJson(getRssSource()))
R.id.menu_qr_code_camera -> qrCodeResult.launch(null)
R.id.menu_qr_code_camera -> qrCodeResult.launch()
R.id.menu_paste_source -> viewModel.pasteSource { upRecyclerView(it) }
R.id.menu_share_str -> share(GSON.toJson(getRssSource()))
R.id.menu_share_qr -> shareWithQr(

@ -114,7 +114,7 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
allowExtensions = arrayOf("txt", "json")
}
R.id.menu_import_onLine -> showImportDialog()
R.id.menu_import_qr -> qrCodeResult.launch(null)
R.id.menu_import_qr -> qrCodeResult.launch()
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>()
R.id.menu_import_default -> viewModel.importDefault()
R.id.menu_help -> showHelp()

Loading…
Cancel
Save