mirror of
https://github.com/gedoor/legado.git
synced 2025-01-09 04:17:45 +08:00
Merge branch 'master' of github.com:gedoor/legado
This commit is contained in:
commit
ad1992d493
@ -11,7 +11,6 @@ import io.legado.app.constant.PageAnim
|
||||
import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.help.DefaultData
|
||||
import io.legado.app.help.coroutine.Coroutine
|
||||
import io.legado.app.ui.book.read.page.provider.ChapterProvider
|
||||
import io.legado.app.utils.BitmapUtils
|
||||
import io.legado.app.utils.FileUtils
|
||||
import io.legado.app.utils.GSON
|
||||
|
@ -137,7 +137,7 @@ public class QueryTTF {
|
||||
}
|
||||
|
||||
private static class GlyfLayout {
|
||||
public short numberOfContours; // 非负值为简单字型,负值为符合字型
|
||||
public short numberOfContours; // 非负值为简单字型,负值为复合字型
|
||||
public short xMin;
|
||||
public short yMin;
|
||||
public short xMax;
|
||||
|
@ -93,7 +93,6 @@ import io.legado.app.ui.replace.ReplaceRuleActivity
|
||||
import io.legado.app.ui.replace.edit.ReplaceEditActivity
|
||||
import io.legado.app.ui.widget.PopupAction
|
||||
import io.legado.app.ui.widget.dialog.PhotoDialog
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.utils.ACache
|
||||
import io.legado.app.utils.Debounce
|
||||
import io.legado.app.utils.LogUtils
|
||||
@ -114,6 +113,7 @@ import io.legado.app.utils.observeEvent
|
||||
import io.legado.app.utils.observeEventSticky
|
||||
import io.legado.app.utils.postEvent
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.sysScreenOffTime
|
||||
import io.legado.app.utils.throttle
|
||||
@ -553,7 +553,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
|
||||
R.id.menu_effective_replaces -> showDialogFragment<EffectiveReplacesDialog>()
|
||||
|
||||
R.id.menu_help -> showReadMenuHelp()
|
||||
R.id.menu_help -> showHelp()
|
||||
}
|
||||
return super.onCompatOptionsItemSelected(item)
|
||||
}
|
||||
@ -1022,11 +1022,6 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun showReadMenuHelp() {
|
||||
val text = String(assets.open("web/help/md/readMenuHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示朗读菜单
|
||||
*/
|
||||
@ -1255,6 +1250,10 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun showHelp() {
|
||||
showHelp("readMenuHelp")
|
||||
}
|
||||
|
||||
/**
|
||||
* 长按图片
|
||||
*/
|
||||
|
@ -150,7 +150,7 @@ class ReadMenu @JvmOverloads constructor(
|
||||
}
|
||||
callBack.upSystemUiVisibility()
|
||||
if (!LocalConfig.readMenuHelpVersionIsLast) {
|
||||
callBack.showReadMenuHelp()
|
||||
callBack.showHelp()
|
||||
}
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ class ReadMenu @JvmOverloads constructor(
|
||||
fun showReadAloudDialog()
|
||||
fun upSystemUiVisibility()
|
||||
fun onClickReadAloud()
|
||||
fun showReadMenuHelp()
|
||||
fun showHelp()
|
||||
fun showLogin()
|
||||
fun payAction()
|
||||
fun disableSource()
|
||||
|
@ -17,8 +17,14 @@ import io.legado.app.ui.login.SourceLoginActivity
|
||||
import io.legado.app.ui.widget.code.addJsPattern
|
||||
import io.legado.app.ui.widget.code.addJsonPattern
|
||||
import io.legado.app.ui.widget.code.addLegadoPattern
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.utils.*
|
||||
import io.legado.app.utils.GSON
|
||||
import io.legado.app.utils.applyTint
|
||||
import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setLayout
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit, true),
|
||||
@ -111,7 +117,7 @@ class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit, tr
|
||||
initView(it)
|
||||
}
|
||||
R.id.menu_log -> showDialogFragment<AppLogDialog>()
|
||||
R.id.menu_help -> help()
|
||||
R.id.menu_help -> showHelp("httpTTSHelp")
|
||||
}
|
||||
return true
|
||||
}
|
||||
@ -130,11 +136,4 @@ class HttpTtsEditDialog() : BaseDialogFragment(R.layout.dialog_http_tts_edit, tr
|
||||
)
|
||||
}
|
||||
|
||||
private fun help() {
|
||||
val helpStr = String(
|
||||
requireContext().assets.open("web/help/md/httpTTSHelp.md").readBytes()
|
||||
)
|
||||
showDialogFragment(TextDialog(getString(R.string.help), helpStr, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
}
|
@ -20,6 +20,7 @@ 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.showHelp
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
import kotlinx.coroutines.launch
|
||||
@ -184,14 +185,9 @@ class BookSourceDebugActivity : VMBaseActivity<ActivitySourceDebugBinding, BookS
|
||||
R.id.menu_book_src -> showDialogFragment(TextDialog("html", viewModel.bookSrc))
|
||||
R.id.menu_toc_src -> showDialogFragment(TextDialog("html", viewModel.tocSrc))
|
||||
R.id.menu_content_src -> showDialogFragment(TextDialog("html", viewModel.contentSrc))
|
||||
R.id.menu_help -> showHelp()
|
||||
R.id.menu_help -> showHelp("debugHelp")
|
||||
}
|
||||
return super.onCompatOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
private fun showHelp() {
|
||||
val text = String(assets.open("web/help/md/debugHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
}
|
@ -43,7 +43,6 @@ import io.legado.app.ui.config.CheckSourceConfig
|
||||
import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.widget.SelectActionBar
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
@ -59,6 +58,7 @@ import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.share
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.toastOnUi
|
||||
@ -134,7 +134,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
||||
initSelectActionBar()
|
||||
resumeCheckSource()
|
||||
if (!LocalConfig.bookSourcesHelpVersionIsLast) {
|
||||
showHelp()
|
||||
showHelp("SourceMBookHelp")
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
||||
searchView.setQuery(getString(R.string.disabled_explore), true)
|
||||
}
|
||||
|
||||
R.id.menu_help -> showHelp()
|
||||
R.id.menu_help -> showHelp("SourceMBookHelp")
|
||||
}
|
||||
if (item.groupId == R.id.source_group) {
|
||||
searchView.setQuery("group:${item.title}", true)
|
||||
@ -370,11 +370,6 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHelp() {
|
||||
val text = String(assets.open("web/help/md/SourceMBookHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
private fun initLiveDataGroup() {
|
||||
lifecycleScope.launch {
|
||||
appDb.bookSourceDao.flowGroups().conflate().collect {
|
||||
|
@ -22,7 +22,6 @@ import io.legado.app.ui.association.ImportTxtTocRuleDialog
|
||||
import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.widget.SelectActionBar
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
@ -34,6 +33,7 @@ import io.legado.app.utils.readText
|
||||
import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
@ -140,7 +140,7 @@ class TxtTocRuleActivity : VMBaseActivity<ActivityTxtTocRuleBinding, TxtTocRuleV
|
||||
R.id.menu_import_onLine -> showImportDialog()
|
||||
R.id.menu_import_qr -> qrCodeResult.launch()
|
||||
R.id.menu_import_default -> viewModel.importDefault()
|
||||
R.id.menu_help -> showTxtTocRuleHelp()
|
||||
R.id.menu_help -> showHelp("txtTocRuleHelp")
|
||||
|
||||
}
|
||||
return super.onCompatOptionsItemSelected(item)
|
||||
@ -244,11 +244,6 @@ class TxtTocRuleActivity : VMBaseActivity<ActivityTxtTocRuleBinding, TxtTocRuleV
|
||||
}
|
||||
}
|
||||
|
||||
private fun showTxtTocRuleHelp() {
|
||||
val text = String(assets.open("web/help/md/txtTocRuleHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
override fun onMenuItemClick(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.menu_enable_selection -> viewModel.enableSelection(*adapter.selection.toTypedArray())
|
||||
|
@ -88,7 +88,7 @@ class TxtTocRuleAdapter(context: Context, private val callBack: CallBack) :
|
||||
bundle.keySet().map {
|
||||
when (it) {
|
||||
"selected" -> cbSource.isChecked = selected.contains(item)
|
||||
"upNmae" -> cbSource.text = item.name
|
||||
"upName" -> cbSource.text = item.name
|
||||
"upExample" -> titleExample.text = item.example
|
||||
"enabled" -> swtEnabled.isChecked = item.enable
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.ui.association.ImportTxtTocRuleDialog
|
||||
import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
import io.legado.app.utils.ACache
|
||||
@ -38,6 +37,7 @@ import io.legado.app.utils.launch
|
||||
import io.legado.app.utils.readText
|
||||
import io.legado.app.utils.setLayout
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
@ -152,7 +152,7 @@ class TxtTocRuleDialog() : BaseDialogFragment(R.layout.dialog_toc_regex),
|
||||
R.id.menu_import_onLine -> showImportDialog()
|
||||
R.id.menu_import_qr -> qrCodeResult.launch()
|
||||
R.id.menu_import_default -> viewModel.importDefault()
|
||||
R.id.menu_help -> showTxtTocRuleHelp()
|
||||
R.id.menu_help -> showHelp("txtTocRuleHelp")
|
||||
}
|
||||
return false
|
||||
}
|
||||
@ -197,11 +197,6 @@ class TxtTocRuleDialog() : BaseDialogFragment(R.layout.dialog_toc_regex),
|
||||
}
|
||||
}
|
||||
|
||||
private fun showTxtTocRuleHelp() {
|
||||
val text = String(requireContext().assets.open("web/help/md/txtTocRuleHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
inner class TocRegexAdapter(context: Context) :
|
||||
RecyclerAdapter<TxtTocRule, ItemTocRegexBinding>(context),
|
||||
ItemTouchCallback.Callback {
|
||||
@ -264,7 +259,7 @@ class TxtTocRuleDialog() : BaseDialogFragment(R.layout.dialog_toc_regex),
|
||||
} else {
|
||||
bundle.keySet().map {
|
||||
when (it) {
|
||||
"upNmae" -> rbRegexName.text = item.name
|
||||
"upName" -> rbRegexName.text = item.name
|
||||
"upExample" -> titleExample.text = item.example
|
||||
"enabled" -> swtEnabled.isChecked = item.enable
|
||||
"upSelect" -> rbRegexName.isChecked = item.name == selectedName
|
||||
|
@ -35,9 +35,17 @@ import io.legado.app.lib.prefs.fragment.PreferenceFragment
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
import io.legado.app.ui.about.AppLogDialog
|
||||
import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.dialog.WaitDialog
|
||||
import io.legado.app.utils.*
|
||||
import io.legado.app.utils.applyTint
|
||||
import io.legado.app.utils.checkWrite
|
||||
import io.legado.app.utils.getPrefString
|
||||
import io.legado.app.utils.isContentScheme
|
||||
import io.legado.app.utils.launch
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.toEditable
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Dispatchers.Main
|
||||
import kotlinx.coroutines.Job
|
||||
@ -150,7 +158,7 @@ class BackupConfigFragment : PreferenceFragment(),
|
||||
listView.setEdgeEffectColor(primaryColor)
|
||||
activity?.addMenuProvider(this, viewLifecycleOwner)
|
||||
if (!LocalConfig.backupHelpVersionIsLast) {
|
||||
showHelp()
|
||||
showHelp("webDavHelp")
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,7 +170,7 @@ class BackupConfigFragment : PreferenceFragment(),
|
||||
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
|
||||
when (menuItem.itemId) {
|
||||
R.id.menu_help -> {
|
||||
showHelp()
|
||||
showHelp("webDavHelp")
|
||||
return true
|
||||
}
|
||||
|
||||
@ -171,11 +179,6 @@ class BackupConfigFragment : PreferenceFragment(),
|
||||
return false
|
||||
}
|
||||
|
||||
private fun showHelp() {
|
||||
val text = String(requireContext().assets.open("web/help/md/webDavHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
preferenceManager.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this)
|
||||
|
@ -23,7 +23,6 @@ import io.legado.app.ui.association.ImportDictRuleDialog
|
||||
import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.widget.SelectActionBar
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
@ -35,6 +34,7 @@ import io.legado.app.utils.readText
|
||||
import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
@ -143,7 +143,7 @@ class DictRuleActivity : VMBaseActivity<ActivityDictRuleBinding, DictRuleViewMod
|
||||
R.id.menu_import_onLine -> showImportDialog()
|
||||
R.id.menu_import_qr -> qrCodeResult.launch()
|
||||
R.id.menu_import_default -> viewModel.importDefault()
|
||||
R.id.menu_help -> showDictRuleHelp()
|
||||
R.id.menu_help -> showHelp("dictRuleHelp")
|
||||
}
|
||||
return super.onCompatOptionsItemSelected(item)
|
||||
}
|
||||
@ -235,9 +235,4 @@ class DictRuleActivity : VMBaseActivity<ActivityDictRuleBinding, DictRuleViewMod
|
||||
cancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showDictRuleHelp() {
|
||||
val text = String(assets.open("web/help/md/dictRuleHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
}
|
||||
|
@ -148,6 +148,11 @@ class BookshelfFragment2() : BaseBookshelfFragment(R.layout.fragment_bookshelf2)
|
||||
3 -> list.sortedBy {
|
||||
it.order
|
||||
}
|
||||
|
||||
4 -> list.sortedByDescending {
|
||||
max(it.latestChapterTime, it.durChapterTime)
|
||||
}
|
||||
|
||||
else -> list.sortedByDescending {
|
||||
it.durChapterTime
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import io.legado.app.ui.dict.rule.DictRuleActivity
|
||||
import io.legado.app.ui.file.FileManageActivity
|
||||
import io.legado.app.ui.main.MainFragmentInterface
|
||||
import io.legado.app.ui.replace.ReplaceRuleActivity
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.utils.LogUtils
|
||||
import io.legado.app.utils.getPrefBoolean
|
||||
import io.legado.app.utils.observeEventSticky
|
||||
@ -37,7 +36,7 @@ import io.legado.app.utils.openUrl
|
||||
import io.legado.app.utils.putPrefBoolean
|
||||
import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
|
||||
@ -68,10 +67,7 @@ class MyFragment() : BaseFragment(R.layout.fragment_my_config), MainFragmentInte
|
||||
|
||||
override fun onCompatOptionsItemSelected(item: MenuItem) {
|
||||
when (item.itemId) {
|
||||
R.id.menu_help -> {
|
||||
val text = String(requireContext().assets.open("web/help/md/appHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
R.id.menu_help -> showHelp("appHelp")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@ import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.replace.edit.ReplaceEditActivity
|
||||
import io.legado.app.ui.widget.SelectActionBar
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
@ -47,6 +46,7 @@ import io.legado.app.utils.readText
|
||||
import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.toastOnUi
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
@ -255,7 +255,7 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
|
||||
allowExtensions = arrayOf("txt", "json")
|
||||
}
|
||||
R.id.menu_import_qr -> qrCodeResult.launch()
|
||||
R.id.menu_help -> showHelp()
|
||||
R.id.menu_help -> showHelp("replaceRuleHelp")
|
||||
R.id.menu_group_null -> {
|
||||
searchView.setQuery(getString(R.string.no_group), true)
|
||||
}
|
||||
@ -324,11 +324,6 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHelp() {
|
||||
val text = String(assets.open("web/help/md/replaceRuleHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
override fun onQueryTextChange(newText: String?): Boolean {
|
||||
observeReplaceRuleData(newText)
|
||||
return false
|
||||
|
@ -28,7 +28,6 @@ import io.legado.app.ui.file.HandleFileContract
|
||||
import io.legado.app.ui.qrcode.QrCodeResult
|
||||
import io.legado.app.ui.rss.source.edit.RssSourceEditActivity
|
||||
import io.legado.app.ui.widget.SelectActionBar
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
import io.legado.app.ui.widget.recycler.DragSelectTouchHelper
|
||||
import io.legado.app.ui.widget.recycler.ItemTouchCallback
|
||||
import io.legado.app.ui.widget.recycler.VerticalDivider
|
||||
@ -44,6 +43,7 @@ import io.legado.app.utils.sendToClip
|
||||
import io.legado.app.utils.setEdgeEffectColor
|
||||
import io.legado.app.utils.share
|
||||
import io.legado.app.utils.showDialogFragment
|
||||
import io.legado.app.utils.showHelp
|
||||
import io.legado.app.utils.splitNotBlank
|
||||
import io.legado.app.utils.startActivity
|
||||
import io.legado.app.utils.toastOnUi
|
||||
@ -163,7 +163,7 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
|
||||
R.id.menu_group_null -> {
|
||||
searchView.setQuery(getString(R.string.no_group), true)
|
||||
}
|
||||
R.id.menu_help -> showHelp()
|
||||
R.id.menu_help -> showHelp("SourceMRssHelp")
|
||||
else -> if (item.groupId == R.id.source_group) {
|
||||
searchView.setQuery("group:${item.title}", true)
|
||||
}
|
||||
@ -354,11 +354,6 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHelp() {
|
||||
val text = String(assets.open("web/help/md/SourceMRssHelp.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), text, TextDialog.Mode.MD))
|
||||
}
|
||||
|
||||
override fun upCountView() {
|
||||
binding.selectActionBar.upCountView(
|
||||
adapter.selection.size,
|
||||
|
@ -203,8 +203,10 @@ val Activity.navigationBarGravity: Int
|
||||
return gravity ?: Gravity.BOTTOM
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示目录help下的帮助文档
|
||||
*/
|
||||
fun AppCompatActivity.showHelp(fileName: String) {
|
||||
//显示目录help下的帮助文档
|
||||
val mdText = String(assets.open("web/help/md/${fileName}.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), mdText, TextDialog.Mode.MD))
|
||||
}
|
@ -32,14 +32,16 @@ object ChineseUtils {
|
||||
fun fixT2sDict() {
|
||||
val dict = DictionaryContainer.getInstance().getDictionary(TransType.TRADITIONAL_TO_SIMPLE)
|
||||
dict.run {
|
||||
remove("劈", "脊", "槃")
|
||||
remove("支援", "沈默", "類比", "模擬", "划槳", "列根", "先進", "雪梨", "雪糕")
|
||||
remove("零錢", "零钱", "離線", "碟片", "模組", "桌球", "案頭", "機車", "電漿")
|
||||
remove("鳳梨", "魔戒", "載入")
|
||||
remove("路易斯", "非同步", "出租车", "周杰倫", "马铃薯", "馬鈴薯", "機械人", "電單車")
|
||||
remove("電扶梯", "音效卡", "飆車族", "點陣圖", "個入球", "顆進球")
|
||||
remove("魔獸紀元", "高空彈跳", "铁达尼号")
|
||||
remove("魔鬼終結者", "純文字檔案")
|
||||
remove(
|
||||
"劈", "脊", "槃",
|
||||
"支援", "沈默", "類比", "模擬", "划槳", "列根", "先進", "雪梨", "雪糕",
|
||||
"零錢", "零钱", "離線", "碟片", "模組", "桌球", "案頭", "機車", "電漿",
|
||||
"鳳梨", "魔戒", "載入",
|
||||
"路易斯", "非同步", "出租车", "周杰倫", "马铃薯", "馬鈴薯", "機械人", "電單車",
|
||||
"電扶梯", "音效卡", "飆車族", "點陣圖", "個入球", "顆進球",
|
||||
"魔獸紀元", "高空彈跳", "铁达尼号",
|
||||
"魔鬼終結者", "純文字檔案"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ import androidx.annotation.DrawableRes
|
||||
import androidx.core.content.edit
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import io.legado.app.R
|
||||
import io.legado.app.ui.widget.dialog.TextDialog
|
||||
|
||||
inline fun <reified T : DialogFragment> Fragment.showDialogFragment(
|
||||
arguments: Bundle.() -> Unit = {}
|
||||
@ -76,4 +78,9 @@ inline fun <reified T : Activity> Fragment.startActivity(
|
||||
configIntent: Intent.() -> Unit = {}
|
||||
) {
|
||||
startActivity(Intent(requireContext(), T::class.java).apply(configIntent))
|
||||
}
|
||||
|
||||
fun Fragment.showHelp(fileName: String) {
|
||||
val mdText = String(requireContext().assets.open("web/help/md/${fileName}.md").readBytes())
|
||||
showDialogFragment(TextDialog(getString(R.string.help), mdText, TextDialog.Mode.MD))
|
||||
}
|
Loading…
Reference in New Issue
Block a user