pull/433/head
gedoor 4 years ago
parent 91a332fbb9
commit 0cef6b0ad1
  1. 0
      app/src/main/assets/help/help.md
  2. 15
      app/src/main/assets/help/httpTts.md
  3. 6
      app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt
  4. 2
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt

@ -0,0 +1,15 @@
# 在线朗读规则说明
* 在线朗读规则为url规则,同书源url
* js参数
~~~
speakText //朗读文本
speakSpeed //朗读速度,0-45
~~~
* 例:
~~~
http://tts.baidu.com/text2audio,{
"method": "POST",
"body": "tex={{java.encodeURI(java.encodeURI(speakText))}}&spd={{String((speakSpeed + 5) / 10 + 4)}}&per=5003&cuid=baidu_speech_demo&idx=1&cod=2&lan=zh&ctp=1&pdt=1&vol=5&pit=5&_res_tag_=audio"
}
~~~

@ -30,6 +30,7 @@ import kotlinx.android.synthetic.main.dialog_http_tts_edit.view.*
import kotlinx.android.synthetic.main.dialog_recycler_view.*
import kotlinx.android.synthetic.main.item_http_tts.view.*
import org.jetbrains.anko.sdk27.listeners.onClick
import java.io.File
class SpeakEngineDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
@ -128,7 +129,10 @@ class SpeakEngineDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
}
}
neutralButton(R.string.help) {
TextDialog.show(childFragmentManager, "")
val helpStr = String(
requireContext().assets.open("help${File.separator}httpTts.md").readBytes()
)
TextDialog.show(childFragmentManager, helpStr, TextDialog.MD)
}
}.show().applyTint()
}

@ -54,7 +54,7 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog.
override fun onCompatOptionsItemSelected(item: MenuItem) {
when (item.itemId) {
R.id.menu_help -> {
val text = String(requireContext().assets.open("help.md").readBytes())
val text = String(requireContext().assets.open("help/help.md").readBytes())
TextDialog.show(childFragmentManager, text, TextDialog.MD)
}
}

Loading…
Cancel
Save