pull/32/head
kunfei 5 years ago
parent 229fb9da7f
commit 0c0fa87ea7
  1. 12
      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<SourceEditViewModel>(false), KeyboardToo
viewModel.save(bookSource) { finish() }
}
}
R.id.action_debug_source -> {
val bookSource = getSource()
if (bookSource == null) {
toast("书源名称和URL不能为空")
} else {
viewModel.save(bookSource) {
startActivity<SourceDebugActivity>(Pair("key", bookSource.bookSourceUrl))
}
}
}
}
return super.onCompatOptionsItemSelected(item)
}

Loading…
Cancel
Save