From 0c0fa87ea7b4726ea14db04ee76c97ed96fd1ee5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 27 Jul 2019 23:28:04 +0800 Subject: [PATCH] up --- .../legado/app/ui/sourceedit/SourceEditActivity.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt index 2399d0135..ebf9cb9b2 100644 --- a/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/sourceedit/SourceEditActivity.kt @@ -15,11 +15,13 @@ import io.legado.app.R import io.legado.app.base.BaseActivity import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.rule.* +import io.legado.app.ui.sourcedebug.SourceDebugActivity import io.legado.app.ui.widget.KeyboardToolPop import io.legado.app.utils.GSON import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_source_edit.* import org.jetbrains.anko.displayMetrics +import org.jetbrains.anko.startActivity import org.jetbrains.anko.toast import kotlin.math.abs @@ -72,6 +74,16 @@ class SourceEditActivity : BaseActivity(false), KeyboardToo viewModel.save(bookSource) { finish() } } } + R.id.action_debug_source -> { + val bookSource = getSource() + if (bookSource == null) { + toast("书源名称和URL不能为空") + } else { + viewModel.save(bookSource) { + startActivity(Pair("key", bookSource.bookSourceUrl)) + } + } + } } return super.onCompatOptionsItemSelected(item) }