mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化翻译
This commit is contained in:
parent
4d2a7e5d7d
commit
e73f7d8ba5
@ -1,5 +1,6 @@
|
||||
package io.legado.app.help
|
||||
|
||||
import android.content.Context
|
||||
import io.legado.app.R
|
||||
import splitties.init.appCtx
|
||||
|
||||
@ -7,19 +8,6 @@ object ReadTipConfig {
|
||||
val tips by lazy {
|
||||
appCtx.resources.getStringArray(R.array.read_tip).toList()
|
||||
}
|
||||
val headerModes by lazy {
|
||||
linkedMapOf(
|
||||
Pair(0, appCtx.getString(R.string.hide_when_status_bar_show)),
|
||||
Pair(1, appCtx.getString(R.string.show)),
|
||||
Pair(2, appCtx.getString(R.string.hide))
|
||||
)
|
||||
}
|
||||
val footerModes by lazy {
|
||||
linkedMapOf(
|
||||
Pair(0, appCtx.getString(R.string.show)),
|
||||
Pair(1, appCtx.getString(R.string.hide))
|
||||
)
|
||||
}
|
||||
const val none = 0
|
||||
const val chapterTitle = 1
|
||||
const val time = 2
|
||||
@ -90,4 +78,19 @@ object ReadTipConfig {
|
||||
set(value) {
|
||||
ReadBookConfig.config.tipColor = value
|
||||
}
|
||||
|
||||
fun getHeaderModes(context: Context): LinkedHashMap<Int, String> {
|
||||
return linkedMapOf(
|
||||
Pair(0, context.getString(R.string.hide_when_status_bar_show)),
|
||||
Pair(1, context.getString(R.string.show)),
|
||||
Pair(2, context.getString(R.string.hide))
|
||||
)
|
||||
}
|
||||
|
||||
fun getFooterModes(context: Context): LinkedHashMap<Int, String> {
|
||||
return linkedMapOf(
|
||||
Pair(0, context.getString(R.string.show)),
|
||||
Pair(1, context.getString(R.string.hide))
|
||||
)
|
||||
}
|
||||
}
|
@ -52,8 +52,8 @@ class TipConfigDialog : BaseDialogFragment() {
|
||||
dsbTitleTop.progress = ReadBookConfig.titleTopSpacing
|
||||
dsbTitleBottom.progress = ReadBookConfig.titleBottomSpacing
|
||||
|
||||
tvHeaderShow.text = ReadTipConfig.headerModes[ReadTipConfig.headerMode]
|
||||
tvFooterShow.text = ReadTipConfig.footerModes[ReadTipConfig.footerMode]
|
||||
tvHeaderShow.text = ReadTipConfig.getHeaderModes(requireContext())[ReadTipConfig.headerMode]
|
||||
tvFooterShow.text = ReadTipConfig.getFooterModes(requireContext())[ReadTipConfig.footerMode]
|
||||
|
||||
tvHeaderLeft.text = ReadTipConfig.tipHeaderLeftStr
|
||||
tvHeaderMiddle.text = ReadTipConfig.tipHeaderMiddleStr
|
||||
@ -92,16 +92,18 @@ class TipConfigDialog : BaseDialogFragment() {
|
||||
postEvent(EventBus.UP_CONFIG, true)
|
||||
}
|
||||
llHeaderShow.setOnClickListener {
|
||||
selector(items = ReadTipConfig.headerModes.values.toList()) { _, i ->
|
||||
ReadTipConfig.headerMode = ReadTipConfig.headerModes.keys.toList()[i]
|
||||
tvHeaderShow.text = ReadTipConfig.headerModes[ReadTipConfig.headerMode]
|
||||
val headerModes = ReadTipConfig.getHeaderModes(requireContext())
|
||||
selector(items = headerModes.values.toList()) { _, i ->
|
||||
ReadTipConfig.headerMode = headerModes.keys.toList()[i]
|
||||
tvHeaderShow.text = headerModes[ReadTipConfig.headerMode]
|
||||
postEvent(EventBus.UP_CONFIG, true)
|
||||
}
|
||||
}
|
||||
llFooterShow.setOnClickListener {
|
||||
selector(items = ReadTipConfig.footerModes.values.toList()) { _, i ->
|
||||
ReadTipConfig.footerMode = ReadTipConfig.footerModes.keys.toList()[i]
|
||||
tvFooterShow.text = ReadTipConfig.footerModes[ReadTipConfig.footerMode]
|
||||
val footerModes = ReadTipConfig.getFooterModes(requireContext())
|
||||
selector(items = footerModes.values.toList()) { _, i ->
|
||||
ReadTipConfig.footerMode = footerModes.keys.toList()[i]
|
||||
tvFooterShow.text = footerModes[ReadTipConfig.footerMode]
|
||||
postEvent(EventBus.UP_CONFIG, true)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user