|
|
@ -20,6 +20,7 @@ import io.legado.app.lib.theme.ATH |
|
|
|
import io.legado.app.ui.qrcode.QrCodeActivity |
|
|
|
import io.legado.app.ui.qrcode.QrCodeActivity |
|
|
|
import io.legado.app.ui.rss.source.debug.RssSourceDebugActivity |
|
|
|
import io.legado.app.ui.rss.source.debug.RssSourceDebugActivity |
|
|
|
import io.legado.app.ui.widget.KeyboardToolPop |
|
|
|
import io.legado.app.ui.widget.KeyboardToolPop |
|
|
|
|
|
|
|
import io.legado.app.ui.widget.dialog.TextDialog |
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.* |
|
|
|
import kotlinx.android.synthetic.main.activity_rss_source_edit.* |
|
|
|
import kotlinx.android.synthetic.main.activity_rss_source_edit.* |
|
|
|
import org.jetbrains.anko.* |
|
|
|
import org.jetbrains.anko.* |
|
|
@ -187,12 +188,28 @@ class RssSourceEditActivity : |
|
|
|
|
|
|
|
|
|
|
|
override fun sendText(text: String) { |
|
|
|
override fun sendText(text: String) { |
|
|
|
if (text == AppConst.keyboardToolChars[0]) { |
|
|
|
if (text == AppConst.keyboardToolChars[0]) { |
|
|
|
insertText(AppConst.urlOption) |
|
|
|
showHelpDialog() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
insertText(text) |
|
|
|
insertText(text) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun showHelpDialog() { |
|
|
|
|
|
|
|
val items = arrayListOf("插入URL参数", "订阅源教程", "正则教程") |
|
|
|
|
|
|
|
selector(getString(R.string.help), items) { _, index -> |
|
|
|
|
|
|
|
when (index) { |
|
|
|
|
|
|
|
0 -> insertText(AppConst.urlOption) |
|
|
|
|
|
|
|
1 -> openUrl("https://alanskycn.gitee.io/teachme/Rule/rss.html") |
|
|
|
|
|
|
|
2 -> showRegexHelp() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun showRegexHelp() { |
|
|
|
|
|
|
|
val mdText = String(assets.open("help/regex.md").readBytes()) |
|
|
|
|
|
|
|
TextDialog.show(supportFragmentManager, mdText, TextDialog.MD) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun showKeyboardTopPopupWindow() { |
|
|
|
private fun showKeyboardTopPopupWindow() { |
|
|
|
mSoftKeyboardTool?.let { |
|
|
|
mSoftKeyboardTool?.let { |
|
|
|
if (it.isShowing) return |
|
|
|
if (it.isShowing) return |
|
|
|