重新规划了阅读设置与相关修复 #251
This commit is contained in:
@@ -32,6 +32,7 @@ import io.legado.app.model.CacheBook
|
|||||||
import io.legado.app.model.ReadBook
|
import io.legado.app.model.ReadBook
|
||||||
import io.legado.app.ui.book.read.config.BgTextConfigDialog
|
import io.legado.app.ui.book.read.config.BgTextConfigDialog
|
||||||
import io.legado.app.ui.book.read.config.ClickActionConfigDialog
|
import io.legado.app.ui.book.read.config.ClickActionConfigDialog
|
||||||
|
import io.legado.app.ui.book.read.config.InfoConfigDialog
|
||||||
import io.legado.app.ui.book.read.config.PaddingConfigDialog
|
import io.legado.app.ui.book.read.config.PaddingConfigDialog
|
||||||
import io.legado.app.ui.book.read.config.PageKeyDialog
|
import io.legado.app.ui.book.read.config.PageKeyDialog
|
||||||
import io.legado.app.ui.file.HandleFileContract
|
import io.legado.app.ui.file.HandleFileContract
|
||||||
@@ -127,7 +128,7 @@ abstract class BaseReadBookActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun showPaddingConfig() {
|
fun showPaddingConfig() {
|
||||||
showDialogFragment<PaddingConfigDialog>()
|
showDialogFragment<InfoConfigDialog>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showBgTextConfig() {
|
fun showBgTextConfig() {
|
||||||
|
|||||||
@@ -1748,7 +1748,10 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
when (value) {
|
when (value) {
|
||||||
0 -> upSystemUiVisibility()
|
0 -> upSystemUiVisibility()
|
||||||
1 -> readView.upBg()
|
1 -> readView.upBg()
|
||||||
2 -> readView.upStyle()
|
2 -> {
|
||||||
|
readView.upStyle()
|
||||||
|
binding.readMenu.reset()
|
||||||
|
}
|
||||||
3 -> readView.upBgAlpha()
|
3 -> readView.upBgAlpha()
|
||||||
4 -> readView.upPageSlopSquare()
|
4 -> readView.upPageSlopSquare()
|
||||||
5 -> if (isInitFinish) ReadBook.loadContent(resetPageOffset = false)
|
5 -> if (isInitFinish) ReadBook.loadContent(resetPageOffset = false)
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ class BgTextConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_bg
|
|||||||
ItemBgImageBinding.inflate(layoutInflater, it, false).apply {
|
ItemBgImageBinding.inflate(layoutInflater, it, false).apply {
|
||||||
tvName.text = getString(R.string.select_image)
|
tvName.text = getString(R.string.select_image)
|
||||||
ivBg.setImageResource(R.drawable.ic_add)
|
ivBg.setImageResource(R.drawable.ic_add)
|
||||||
swUnderline.isGone = ReadBook.book?.isImage == true
|
|
||||||
root.setOnClickListener {
|
root.setOnClickListener {
|
||||||
selectBgImage.launch()
|
selectBgImage.launch()
|
||||||
}
|
}
|
||||||
@@ -130,9 +129,6 @@ class BgTextConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_bg
|
|||||||
private fun initData() = with(ReadBookConfig.durConfig) {
|
private fun initData() = with(ReadBookConfig.durConfig) {
|
||||||
binding.tvName.text = name.ifBlank { "文字" }
|
binding.tvName.text = name.ifBlank { "文字" }
|
||||||
binding.swDarkStatusIcon.isChecked = curStatusIconDark()
|
binding.swDarkStatusIcon.isChecked = curStatusIconDark()
|
||||||
binding.swUnderline.isChecked = underline
|
|
||||||
binding.swDottedline.isChecked = dottedLine
|
|
||||||
binding.swDottedline.isEnabled = underline
|
|
||||||
binding.sbBgAlpha.value = ReadBookConfig.bgAlpha.toFloat()
|
binding.sbBgAlpha.value = ReadBookConfig.bgAlpha.toFloat()
|
||||||
binding.dottedRatio.valueFormat = {
|
binding.dottedRatio.valueFormat = {
|
||||||
(ReadBookConfig.dottedRatio * 100).toInt().toString()
|
(ReadBookConfig.dottedRatio * 100).toInt().toString()
|
||||||
@@ -175,27 +171,6 @@ class BgTextConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_bg
|
|||||||
setCurStatusIconDark(isChecked)
|
setCurStatusIconDark(isChecked)
|
||||||
(activity as? ReadBookActivity)?.upSystemUiVisibility()
|
(activity as? ReadBookActivity)?.upSystemUiVisibility()
|
||||||
}
|
}
|
||||||
binding.swUnderline.setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
underline = isChecked
|
|
||||||
binding.swDottedline.isEnabled = isChecked
|
|
||||||
if (!isChecked) {
|
|
||||||
dottedLine = false
|
|
||||||
binding.swDottedline.isChecked = false
|
|
||||||
}
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(6, 9, 11))
|
|
||||||
}
|
|
||||||
binding.swDottedline.setOnCheckedChangeListener { _, isChecked ->
|
|
||||||
dottedLine = isChecked
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(6, 9, 11))
|
|
||||||
}
|
|
||||||
binding.tvTextColor.setOnClickListener {
|
|
||||||
ColorPickerDialog.newBuilder()
|
|
||||||
.setColor(curTextColor())
|
|
||||||
.setShowAlphaSlider(false)
|
|
||||||
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
|
||||||
.setDialogId(TEXT_COLOR)
|
|
||||||
.show(requireActivity())
|
|
||||||
}
|
|
||||||
binding.tvBgColor.setOnClickListener {
|
binding.tvBgColor.setOnClickListener {
|
||||||
val bgColor =
|
val bgColor =
|
||||||
if (curBgType() == 0) curBgStr().toColorInt()
|
if (curBgType() == 0) curBgStr().toColorInt()
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ import io.legado.app.constant.PreferKey
|
|||||||
import io.legado.app.databinding.DialogFontSelectBinding
|
import io.legado.app.databinding.DialogFontSelectBinding
|
||||||
import io.legado.app.databinding.ItemFontBinding
|
import io.legado.app.databinding.ItemFontBinding
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
|
import io.legado.app.help.config.ReadBookConfig.dottedLine
|
||||||
|
import io.legado.app.help.config.ReadBookConfig.underline
|
||||||
import io.legado.app.lib.dialogs.SelectItem
|
import io.legado.app.lib.dialogs.SelectItem
|
||||||
import io.legado.app.lib.dialogs.alert
|
import io.legado.app.lib.dialogs.alert
|
||||||
import io.legado.app.lib.permission.Permissions
|
import io.legado.app.lib.permission.Permissions
|
||||||
import io.legado.app.lib.permission.PermissionsCompat
|
import io.legado.app.lib.permission.PermissionsCompat
|
||||||
|
import io.legado.app.ui.book.read.config.BgTextConfigDialog.Companion.TEXT_COLOR
|
||||||
import io.legado.app.ui.file.HandleFileContract
|
import io.legado.app.ui.file.HandleFileContract
|
||||||
import io.legado.app.utils.FileDoc
|
import io.legado.app.utils.FileDoc
|
||||||
import io.legado.app.utils.FileUtils
|
import io.legado.app.utils.FileUtils
|
||||||
@@ -40,6 +43,7 @@ import io.legado.app.utils.invisible
|
|||||||
import io.legado.app.utils.isContentScheme
|
import io.legado.app.utils.isContentScheme
|
||||||
import io.legado.app.utils.list
|
import io.legado.app.utils.list
|
||||||
import io.legado.app.utils.listFileDocs
|
import io.legado.app.utils.listFileDocs
|
||||||
|
import io.legado.app.utils.observeEvent
|
||||||
import io.legado.app.utils.postEvent
|
import io.legado.app.utils.postEvent
|
||||||
import io.legado.app.utils.printOnDebug
|
import io.legado.app.utils.printOnDebug
|
||||||
import io.legado.app.utils.putPrefString
|
import io.legado.app.utils.putPrefString
|
||||||
@@ -47,14 +51,14 @@ import io.legado.app.utils.toastOnUi
|
|||||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||||
import io.legado.app.utils.visible
|
import io.legado.app.utils.visible
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import splitties.resources.color
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字体选择对话框
|
* 字体选择对话框
|
||||||
*/
|
*/
|
||||||
class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_select),
|
class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_select) {
|
||||||
Toolbar.OnMenuItemClickListener {
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val S_COLOR = 123
|
const val S_COLOR = 123
|
||||||
@@ -88,14 +92,14 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
|
|
||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
//binding.toolBar.setBackgroundColor(primaryColor)
|
//binding.toolBar.setBackgroundColor(primaryColor)
|
||||||
binding.toolBar.setTitle(R.string.select_font)
|
|
||||||
binding.toolBar.inflateMenu(R.menu.font_select)
|
|
||||||
binding.toolBar.menu.applyTint(requireContext())
|
|
||||||
binding.toolBar.setOnMenuItemClickListener(this)
|
|
||||||
binding.recyclerView.layoutManager = GridLayoutManager(context, 2)
|
binding.recyclerView.layoutManager = GridLayoutManager(context, 2)
|
||||||
binding.recyclerView.adapter = adapter
|
binding.recyclerView.adapter = adapter
|
||||||
|
observeEvent<ArrayList<Int>>(EventBus.UP_CONFIG) { list ->
|
||||||
|
if (list.contains(2)) {
|
||||||
|
binding.btnTextColor.color = ReadBookConfig.durConfig.curTextColor()
|
||||||
|
binding.btnShadowColor.color = ReadBookConfig.durConfig.curTextShadowColor()
|
||||||
|
}
|
||||||
|
}
|
||||||
initView()
|
initView()
|
||||||
upView()
|
upView()
|
||||||
initViewEvent()
|
initViewEvent()
|
||||||
@@ -118,7 +122,10 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
loadFontFilesByPermission(fontPath)
|
loadFontFilesByPermission(fontPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
binding.btnTextColor.color = ReadBookConfig.durConfig.curTextColor()
|
||||||
|
binding.swUnderline.isChecked = underline
|
||||||
|
binding.swDottedline.isChecked = dottedLine
|
||||||
|
binding.swDottedline.isEnabled = underline
|
||||||
dsbTextLetterSpacing.valueFormat = {
|
dsbTextLetterSpacing.valueFormat = {
|
||||||
((it - 50) / 100f).toString()
|
((it - 50) / 100f).toString()
|
||||||
}
|
}
|
||||||
@@ -126,17 +133,19 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
binding.dsbShadowRadius.valueFormat = { "$it px" }
|
binding.dsbShadowRadius.valueFormat = { "$it px" }
|
||||||
binding.dsbShadowDx.valueFormat = { "$it px" }
|
binding.dsbShadowDx.valueFormat = { "$it px" }
|
||||||
binding.dsbShadowDy.valueFormat = { "$it px" }
|
binding.dsbShadowDy.valueFormat = { "$it px" }
|
||||||
|
binding.dsbParagraphSpacing.valueFormat = { value ->
|
||||||
binding.textIndentDropdown.apply {
|
(value / 10f).toString()
|
||||||
val items = listOf("0", "1", "2", "3", "4")
|
}
|
||||||
val adapter = ArrayAdapter(context, android.R.layout.simple_list_item_1, items)
|
binding.btnIndentLayout.apply {
|
||||||
setAdapter(adapter)
|
valueFormat = { value ->
|
||||||
val currentIndex = ReadBookConfig.paragraphIndent.length.coerceIn(0, items.lastIndex)
|
value.toString()
|
||||||
setText(items[currentIndex], false)
|
}
|
||||||
setOnItemClickListener { _, _, position, _ ->
|
onChanged = { value ->
|
||||||
ReadBookConfig.paragraphIndent = " ".repeat(position)
|
val indentCount = value.coerceIn(0, 4)
|
||||||
|
ReadBookConfig.paragraphIndent = " ".repeat(indentCount)
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||||
}
|
}
|
||||||
|
progress = ReadBookConfig.paragraphIndent.length
|
||||||
}
|
}
|
||||||
|
|
||||||
val weightOptions = context?.resources?.getStringArray(R.array.text_font_weight)
|
val weightOptions = context?.resources?.getStringArray(R.array.text_font_weight)
|
||||||
@@ -172,6 +181,7 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
|
|
||||||
binding.btnTextItalic.isChecked = ReadBookConfig.textItalic
|
binding.btnTextItalic.isChecked = ReadBookConfig.textItalic
|
||||||
binding.btnTextShadow.isChecked = ReadBookConfig.textShadow
|
binding.btnTextShadow.isChecked = ReadBookConfig.textShadow
|
||||||
|
binding.btnShadowColor.color = ReadBookConfig.textShadowColor
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initViewEvent() = binding.run {
|
private fun initViewEvent() = binding.run {
|
||||||
@@ -183,21 +193,48 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
ReadBookConfig.lineSpacingExtra = it
|
ReadBookConfig.lineSpacingExtra = it
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||||
}
|
}
|
||||||
binding.dsbParagraphSpacing.apply {
|
binding.btnTextColor.setOnClickListener {
|
||||||
valueFrom = 0f
|
ColorPickerDialog.newBuilder()
|
||||||
valueTo = 20f
|
.setColor(ReadBookConfig.durConfig.curTextColor())
|
||||||
stepSize = 1f
|
.setShowAlphaSlider(false)
|
||||||
value = ReadBookConfig.paragraphSpacing.toFloat()
|
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
||||||
textParagraphSpacing.text = (ReadBookConfig.paragraphSpacing.toFloat() / 10f).toString()
|
.setDialogId(TEXT_COLOR)
|
||||||
addOnChangeListener { slider, newValue, fromUser ->
|
.show(requireActivity())
|
||||||
binding.textParagraphSpacing.text = (newValue / 10f).toString()
|
}
|
||||||
|
|
||||||
if (fromUser) {
|
binding.swUnderline.addOnCheckedChangeListener { _, isChecked ->
|
||||||
ReadBookConfig.paragraphSpacing = newValue.toInt()
|
underline = isChecked
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
binding.swDottedline.isEnabled = isChecked
|
||||||
|
if (!isChecked) {
|
||||||
|
dottedLine = false
|
||||||
|
binding.swDottedline.isChecked = false
|
||||||
|
}
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(6, 9, 11))
|
||||||
|
}
|
||||||
|
binding.swDottedline.addOnCheckedChangeListener { _, isChecked ->
|
||||||
|
dottedLine = isChecked
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(6, 9, 11))
|
||||||
|
}
|
||||||
|
binding.btnDefaultFonts.setOnClickListener {
|
||||||
|
val requireContext = requireContext()
|
||||||
|
alert(titleResource = R.string.system_typeface) {
|
||||||
|
items(
|
||||||
|
requireContext.resources.getStringArray(R.array.system_typefaces).toList()
|
||||||
|
) { _, i ->
|
||||||
|
AppConfig.systemTypefaces = i
|
||||||
|
onDefaultFontChange()
|
||||||
|
dismissAllowingStateLoss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
binding.btnOtherDir.setOnClickListener {
|
||||||
|
openFolder()
|
||||||
|
}
|
||||||
|
binding.dsbParagraphSpacing.onChanged = { value ->
|
||||||
|
ReadBookConfig.paragraphSpacing = value
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||||
|
}
|
||||||
|
|
||||||
binding.btnTextItalic.addOnCheckedChangeListener { _, isChecked ->
|
binding.btnTextItalic.addOnCheckedChangeListener { _, isChecked ->
|
||||||
ReadBookConfig.textItalic = isChecked
|
ReadBookConfig.textItalic = isChecked
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||||
@@ -233,34 +270,13 @@ class FontSelectDialog : BaseBottomSheetDialogFragment(R.layout.dialog_font_sele
|
|||||||
ReadBookConfig.let {
|
ReadBookConfig.let {
|
||||||
dsbTextLetterSpacing.progress = (it.letterSpacing * 100).toInt() + 50
|
dsbTextLetterSpacing.progress = (it.letterSpacing * 100).toInt() + 50
|
||||||
dsbLineSize.progress = it.lineSpacingExtra
|
dsbLineSize.progress = it.lineSpacingExtra
|
||||||
dsbParagraphSpacing.value = it.paragraphSpacing.toFloat()
|
dsbParagraphSpacing.progress = it.paragraphSpacing
|
||||||
binding.dsbShadowRadius.progress = it.shadowRadius.toInt()
|
binding.dsbShadowRadius.progress = it.shadowRadius.toInt()
|
||||||
binding.dsbShadowDx.progress = it.shadowDx.toInt()
|
binding.dsbShadowDx.progress = it.shadowDx.toInt()
|
||||||
binding.dsbShadowDy.progress = it.shadowDy.toInt()
|
binding.dsbShadowDy.progress = it.shadowDy.toInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
|
||||||
when (item?.itemId) {
|
|
||||||
R.id.menu_default -> {
|
|
||||||
val requireContext = requireContext()
|
|
||||||
alert(titleResource = R.string.system_typeface) {
|
|
||||||
items(
|
|
||||||
requireContext.resources.getStringArray(R.array.system_typefaces).toList()
|
|
||||||
) { _, i ->
|
|
||||||
AppConfig.systemTypefaces = i
|
|
||||||
onDefaultFontChange()
|
|
||||||
dismissAllowingStateLoss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
R.id.menu_other -> {
|
|
||||||
openFolder()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun openFolder() {
|
private fun openFolder() {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
val defaultPath = "SD${File.separator}Fonts"
|
val defaultPath = "SD${File.separator}Fonts"
|
||||||
|
|||||||
@@ -0,0 +1,242 @@
|
|||||||
|
package io.legado.app.ui.book.read.config
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import com.google.android.material.chip.Chip
|
||||||
|
import com.jaredrummler.android.colorpicker.ColorPickerDialog
|
||||||
|
import io.legado.app.R
|
||||||
|
import io.legado.app.base.BaseBottomSheetDialogFragment
|
||||||
|
import io.legado.app.constant.EventBus
|
||||||
|
import io.legado.app.databinding.DialogReadInfoBinding
|
||||||
|
import io.legado.app.help.config.ReadBookConfig
|
||||||
|
import io.legado.app.help.config.ReadTipConfig
|
||||||
|
import io.legado.app.lib.dialogs.selector
|
||||||
|
import io.legado.app.model.ReadBook
|
||||||
|
import io.legado.app.ui.book.read.config.TipConfigDialog.Companion.TIP_COLOR
|
||||||
|
import io.legado.app.ui.book.read.config.TipConfigDialog.Companion.TIP_DIVIDER_COLOR
|
||||||
|
import io.legado.app.ui.book.read.page.provider.ChapterProvider
|
||||||
|
import io.legado.app.utils.getCompatColor
|
||||||
|
import io.legado.app.utils.observeEvent
|
||||||
|
import io.legado.app.utils.postEvent
|
||||||
|
import io.legado.app.utils.showDialogFragment
|
||||||
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||||
|
import kotlin.collections.component1
|
||||||
|
import kotlin.collections.component2
|
||||||
|
|
||||||
|
class InfoConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_info) {
|
||||||
|
|
||||||
|
private val binding by viewBinding(DialogReadInfoBinding::bind)
|
||||||
|
|
||||||
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
initView()
|
||||||
|
initEvent()
|
||||||
|
observeEvent<String>(EventBus.TIP_COLOR) {
|
||||||
|
upTvTipColor()
|
||||||
|
upTvTipDividerColor()
|
||||||
|
}
|
||||||
|
observeEvent<ArrayList<Int>>(EventBus.UP_CONFIG) { list ->
|
||||||
|
if (list.contains(2)) {
|
||||||
|
upBtnHeaderMode()
|
||||||
|
upBtnFooterMode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initView() {
|
||||||
|
ReadTipConfig.run {
|
||||||
|
tipNames.let { tipNames ->
|
||||||
|
binding.tvHeaderLeft.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipHeaderLeft)) { tipNames[none] }
|
||||||
|
binding.tvHeaderMiddle.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipHeaderMiddle)) { tipNames[none] }
|
||||||
|
binding.tvHeaderRight.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipHeaderRight)) { tipNames[none] }
|
||||||
|
binding.tvFooterLeft.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipFooterLeft)) { tipNames[none] }
|
||||||
|
binding.tvFooterMiddle.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipFooterMiddle)) { tipNames[none] }
|
||||||
|
binding.tvFooterRight.text =
|
||||||
|
tipNames.getOrElse(tipValues.indexOf(tipFooterRight)) { tipNames[none] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.btnPaddingSetting.setOnClickListener {
|
||||||
|
showDialogFragment<PaddingConfigDialog>()
|
||||||
|
}
|
||||||
|
upTvTipColor()
|
||||||
|
upTvTipDividerColor()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun upTvTipColor() {
|
||||||
|
val tipColor = if (ReadTipConfig.tipColor == 0) {
|
||||||
|
ReadBookConfig.textColor
|
||||||
|
} else {
|
||||||
|
ReadTipConfig.tipColor
|
||||||
|
}
|
||||||
|
binding.btnTipColor.color = tipColor
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun upTvTipDividerColor() {
|
||||||
|
val tipDividerColor = when (ReadTipConfig.tipDividerColor) {
|
||||||
|
-1 -> getCompatColor(R.color.divider)
|
||||||
|
0 -> ReadBookConfig.textColor
|
||||||
|
else -> ReadTipConfig.tipDividerColor
|
||||||
|
}
|
||||||
|
binding.btnDividerColor.color = tipDividerColor
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun upBtnHeaderMode() {
|
||||||
|
val headerModes = ReadTipConfig.getHeaderModes(requireContext())
|
||||||
|
binding.btnHeaderMode.text = headerModes[ReadTipConfig.headerMode] ?: getString(R.string.header)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun upBtnFooterMode() {
|
||||||
|
val footerModes = ReadTipConfig.getFooterModes(requireContext())
|
||||||
|
binding.btnFooterMode.text = footerModes[ReadTipConfig.footerMode] ?: getString(R.string.footer)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initEvent() = binding.run {
|
||||||
|
|
||||||
|
val headerModes = ReadTipConfig.getHeaderModes(requireContext())
|
||||||
|
binding.btnHeaderMode.text = headerModes[ReadTipConfig.headerMode] ?: getString(R.string.header)
|
||||||
|
binding.btnHeaderMode.setOnClickListener {
|
||||||
|
val items = headerModes.values.toList()
|
||||||
|
context?.selector(items = items) { _, index ->
|
||||||
|
val selectedKey = headerModes.keys.toList()[index]
|
||||||
|
ReadTipConfig.headerMode = selectedKey
|
||||||
|
binding.btnHeaderMode.text = headerModes[selectedKey]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val footerModes = ReadTipConfig.getFooterModes(requireContext())
|
||||||
|
binding.btnFooterMode.text = footerModes[ReadTipConfig.footerMode] ?: getString(R.string.footer)
|
||||||
|
binding.btnFooterMode.setOnClickListener {
|
||||||
|
val items = footerModes.values.toList()
|
||||||
|
context?.selector(items = items) { _, index ->
|
||||||
|
val selectedKey = footerModes.keys.toList()[index]
|
||||||
|
ReadTipConfig.footerMode = selectedKey
|
||||||
|
binding.btnFooterMode.text = footerModes[selectedKey]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
llHeaderLeft.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipHeaderLeft = tipValue
|
||||||
|
tvHeaderLeft.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
llHeaderMiddle.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipHeaderMiddle = tipValue
|
||||||
|
tvHeaderMiddle.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
llHeaderRight.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipHeaderRight = tipValue
|
||||||
|
tvHeaderRight.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
llFooterLeft.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipFooterLeft = tipValue
|
||||||
|
tvFooterLeft.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
llFooterMiddle.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipFooterMiddle = tipValue
|
||||||
|
tvFooterMiddle.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
llFooterRight.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
||||||
|
val tipValue = ReadTipConfig.tipValues[i]
|
||||||
|
clearRepeat(tipValue)
|
||||||
|
ReadTipConfig.tipFooterRight = tipValue
|
||||||
|
tvFooterRight.text = ReadTipConfig.tipNames[i]
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
btnTipColor.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipColorNames) { _, i ->
|
||||||
|
when (i) {
|
||||||
|
0 -> {
|
||||||
|
ReadTipConfig.tipColor = 0
|
||||||
|
upTvTipColor()
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
||||||
|
}
|
||||||
|
|
||||||
|
1 -> ColorPickerDialog.newBuilder()
|
||||||
|
.setShowAlphaSlider(false)
|
||||||
|
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
||||||
|
.setDialogId(TIP_COLOR)
|
||||||
|
.show(requireActivity())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
btnDividerColor.setOnClickListener {
|
||||||
|
context?.selector(items = ReadTipConfig.tipDividerColorNames) { _, i ->
|
||||||
|
when (i) {
|
||||||
|
0, 1 -> {
|
||||||
|
ReadTipConfig.tipDividerColor = i - 1
|
||||||
|
upTvTipDividerColor()
|
||||||
|
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> ColorPickerDialog.newBuilder()
|
||||||
|
.setShowAlphaSlider(false)
|
||||||
|
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
||||||
|
.setDialogId(TIP_DIVIDER_COLOR)
|
||||||
|
.show(requireActivity())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun clearRepeat(repeat: Int) = ReadTipConfig.apply {
|
||||||
|
if (repeat != none) {
|
||||||
|
if (tipHeaderLeft == repeat) {
|
||||||
|
tipHeaderLeft = none
|
||||||
|
binding.tvHeaderLeft.text = tipNames[none]
|
||||||
|
}
|
||||||
|
if (tipHeaderMiddle == repeat) {
|
||||||
|
tipHeaderMiddle = none
|
||||||
|
binding.tvHeaderMiddle.text = tipNames[none]
|
||||||
|
}
|
||||||
|
if (tipHeaderRight == repeat) {
|
||||||
|
tipHeaderRight = none
|
||||||
|
binding.tvHeaderRight.text = tipNames[none]
|
||||||
|
}
|
||||||
|
if (tipFooterLeft == repeat) {
|
||||||
|
tipFooterLeft = none
|
||||||
|
binding.tvFooterLeft.text = tipNames[none]
|
||||||
|
}
|
||||||
|
if (tipFooterMiddle == repeat) {
|
||||||
|
tipFooterMiddle = none
|
||||||
|
binding.tvFooterMiddle.text = tipNames[none]
|
||||||
|
}
|
||||||
|
if (tipFooterRight == repeat) {
|
||||||
|
tipFooterRight = none
|
||||||
|
binding.tvFooterRight.text = tipNames[none]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -208,17 +208,14 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
|||||||
tvStyle.text = item.name.ifBlank { "文字" }
|
tvStyle.text = item.name.ifBlank { "文字" }
|
||||||
tvStyle.setTextColor(item.curTextColor())
|
tvStyle.setTextColor(item.curTextColor())
|
||||||
ivStyle.setImageDrawable(item.curBgDrawable(100, 150))
|
ivStyle.setImageDrawable(item.curBgDrawable(100, 150))
|
||||||
|
cdStyle.strokeWidth = 1.dpToPx()
|
||||||
if (ReadBookConfig.styleSelect == holder.layoutPosition) {
|
if (ReadBookConfig.styleSelect == holder.layoutPosition) {
|
||||||
llStyle.gravity = Gravity.TOP
|
llStyle.gravity = Gravity.TOP
|
||||||
cdStyle.cardElevation = 1f.dpToPx()
|
cdStyle.radius = 32f.dpToPx()
|
||||||
cdStyle.radius = 16f.dpToPx()
|
|
||||||
cdStyle.strokeWidth = 1.dpToPx()
|
|
||||||
//cdStyle.strokeColor = item.curTextColor()
|
//cdStyle.strokeColor = item.curTextColor()
|
||||||
//tvStyle.setTextBold(true)
|
//tvStyle.setTextBold(true)
|
||||||
} else {
|
} else {
|
||||||
cdStyle.cardElevation = 2f.dpToPx()
|
cdStyle.radius = 8f.dpToPx()
|
||||||
cdStyle.radius = 32f.dpToPx()
|
|
||||||
cdStyle.strokeWidth = 0
|
|
||||||
//cdStyle.strokeColor = item.curTextColor()
|
//cdStyle.strokeColor = item.curTextColor()
|
||||||
//tvStyle.setTextBold(false)
|
//tvStyle.setTextBold(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import io.legado.app.utils.hexString
|
|||||||
import io.legado.app.utils.observeEvent
|
import io.legado.app.utils.observeEvent
|
||||||
import io.legado.app.utils.postEvent
|
import io.legado.app.utils.postEvent
|
||||||
import io.legado.app.utils.requestInputMethod
|
import io.legado.app.utils.requestInputMethod
|
||||||
|
import io.legado.app.utils.showDialogFragment
|
||||||
import io.legado.app.utils.toastOnUi
|
import io.legado.app.utils.toastOnUi
|
||||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||||
|
|
||||||
@@ -41,10 +42,6 @@ class TipConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_tip_config
|
|||||||
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
initView()
|
initView()
|
||||||
initEvent()
|
initEvent()
|
||||||
observeEvent<String>(EventBus.TIP_COLOR) {
|
|
||||||
upTvTipColor()
|
|
||||||
upTvTipDividerColor()
|
|
||||||
}
|
|
||||||
observeEvent<Boolean>(EventBus.UPDATE_READ_ACTION_BAR) {
|
observeEvent<Boolean>(EventBus.UPDATE_READ_ACTION_BAR) {
|
||||||
binding.abtnBackgroundColor.color = ReadBookConfig.durConfig.curMenuBg()
|
binding.abtnBackgroundColor.color = ReadBookConfig.durConfig.curMenuBg()
|
||||||
binding.abtnAccentColor.color = ReadBookConfig.durConfig.curMenuAc()
|
binding.abtnAccentColor.color = ReadBookConfig.durConfig.curMenuAc()
|
||||||
@@ -62,7 +59,6 @@ class TipConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_tip_config
|
|||||||
val weightOptions = context?.resources?.getStringArray(R.array.text_font_weight)
|
val weightOptions = context?.resources?.getStringArray(R.array.text_font_weight)
|
||||||
val weightValues = listOf(0, 1, 2)
|
val weightValues = listOf(0, 1, 2)
|
||||||
val initialIndex = weightValues.indexOf(ReadBookConfig.titleBold)
|
val initialIndex = weightValues.indexOf(ReadBookConfig.titleBold)
|
||||||
binding.textFontWeightConverter.text = weightOptions?.getOrNull(initialIndex) ?: "自定义"
|
|
||||||
binding.textFontWeightConverter.setOnClickListener {
|
binding.textFontWeightConverter.setOnClickListener {
|
||||||
context?.alert(titleResource = R.string.text_font_weight_converter) {
|
context?.alert(titleResource = R.string.text_font_weight_converter) {
|
||||||
weightOptions?.let { options ->
|
weightOptions?.let { options ->
|
||||||
@@ -186,82 +182,6 @@ class TipConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_tip_config
|
|||||||
binding.dsbTitleSize.progress = ReadBookConfig.titleSize
|
binding.dsbTitleSize.progress = ReadBookConfig.titleSize
|
||||||
binding.dsbTitleTop.progress = ReadBookConfig.titleTopSpacing
|
binding.dsbTitleTop.progress = ReadBookConfig.titleTopSpacing
|
||||||
binding.dsbTitleBottom.progress = ReadBookConfig.titleBottomSpacing
|
binding.dsbTitleBottom.progress = ReadBookConfig.titleBottomSpacing
|
||||||
|
|
||||||
val headerModes = ReadTipConfig.getHeaderModes(requireContext())
|
|
||||||
binding.chipHeaderMode.removeAllViews()
|
|
||||||
|
|
||||||
headerModes.forEach { (key, value) ->
|
|
||||||
val chip = Chip(requireContext()).apply {
|
|
||||||
id = View.generateViewId()
|
|
||||||
text = value
|
|
||||||
isCheckable = true
|
|
||||||
isClickable = true
|
|
||||||
tag = key
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.chipHeaderMode.addView(chip)
|
|
||||||
|
|
||||||
if (key == ReadTipConfig.headerMode) {
|
|
||||||
chip.isChecked = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val footerModes = ReadTipConfig.getFooterModes(requireContext())
|
|
||||||
binding.chipFooterMode.removeAllViews()
|
|
||||||
|
|
||||||
footerModes.forEach { (key, value) ->
|
|
||||||
val chip = Chip(requireContext()).apply {
|
|
||||||
id = View.generateViewId()
|
|
||||||
text = value
|
|
||||||
isCheckable = true
|
|
||||||
isClickable = true
|
|
||||||
tag = key
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.chipFooterMode.addView(chip)
|
|
||||||
|
|
||||||
if (key == ReadTipConfig.footerMode) {
|
|
||||||
chip.isChecked = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ReadTipConfig.run {
|
|
||||||
tipNames.let { tipNames ->
|
|
||||||
binding.tvHeaderLeft.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipHeaderLeft)) { tipNames[none] }
|
|
||||||
binding.tvHeaderMiddle.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipHeaderMiddle)) { tipNames[none] }
|
|
||||||
binding.tvHeaderRight.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipHeaderRight)) { tipNames[none] }
|
|
||||||
binding.tvFooterLeft.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipFooterLeft)) { tipNames[none] }
|
|
||||||
binding.tvFooterMiddle.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipFooterMiddle)) { tipNames[none] }
|
|
||||||
binding.tvFooterRight.text =
|
|
||||||
tipNames.getOrElse(tipValues.indexOf(tipFooterRight)) { tipNames[none] }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
upTvTipColor()
|
|
||||||
upTvTipDividerColor()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun upTvTipColor() {
|
|
||||||
val tipColorNames = ReadTipConfig.tipColorNames
|
|
||||||
val tipColor = ReadTipConfig.tipColor
|
|
||||||
binding.tvTipColor.text = if (tipColor == 0) {
|
|
||||||
tipColorNames.first()
|
|
||||||
} else {
|
|
||||||
"#${tipColor.hexString}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun upTvTipDividerColor() {
|
|
||||||
val tipDividerColorNames = ReadTipConfig.tipDividerColorNames
|
|
||||||
val tipDividerColor = ReadTipConfig.tipDividerColor
|
|
||||||
binding.tvTipDividerColor.text = when (tipDividerColor) {
|
|
||||||
-1, 0 -> tipDividerColorNames[tipDividerColor + 1]
|
|
||||||
else -> "#${tipDividerColor.hexString}"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initEvent() = binding.run {
|
private fun initEvent() = binding.run {
|
||||||
@@ -291,139 +211,6 @@ class TipConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_tip_config
|
|||||||
ReadBookConfig.titleBottomSpacing = it
|
ReadBookConfig.titleBottomSpacing = it
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
postEvent(EventBus.UP_CONFIG, arrayListOf(8, 5))
|
||||||
}
|
}
|
||||||
chipHeaderMode.setOnCheckedStateChangeListener { group, checkedIds ->
|
|
||||||
if (checkedIds.isNotEmpty()) {
|
|
||||||
val selectedChip = group.findViewById<Chip>(checkedIds[0])
|
|
||||||
val mode = selectedChip.tag as Int
|
|
||||||
ReadTipConfig.headerMode = mode
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chipFooterMode.setOnCheckedStateChangeListener { group, checkedIds ->
|
|
||||||
if (checkedIds.isNotEmpty()) {
|
|
||||||
val selectedChip = group.findViewById<Chip>(checkedIds[0])
|
|
||||||
val mode = selectedChip.tag as Int
|
|
||||||
ReadTipConfig.footerMode = mode
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llHeaderLeft.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipHeaderLeft = tipValue
|
|
||||||
tvHeaderLeft.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llHeaderMiddle.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipHeaderMiddle = tipValue
|
|
||||||
tvHeaderMiddle.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llHeaderRight.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipHeaderRight = tipValue
|
|
||||||
tvHeaderRight.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llFooterLeft.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipFooterLeft = tipValue
|
|
||||||
tvFooterLeft.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llFooterMiddle.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipFooterMiddle = tipValue
|
|
||||||
tvFooterMiddle.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llFooterRight.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipNames) { _, i ->
|
|
||||||
val tipValue = ReadTipConfig.tipValues[i]
|
|
||||||
clearRepeat(tipValue)
|
|
||||||
ReadTipConfig.tipFooterRight = tipValue
|
|
||||||
tvFooterRight.text = ReadTipConfig.tipNames[i]
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2, 6))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llTipColor.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipColorNames) { _, i ->
|
|
||||||
when (i) {
|
|
||||||
0 -> {
|
|
||||||
ReadTipConfig.tipColor = 0
|
|
||||||
upTvTipColor()
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
|
||||||
}
|
|
||||||
|
|
||||||
1 -> ColorPickerDialog.newBuilder()
|
|
||||||
.setShowAlphaSlider(false)
|
|
||||||
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
|
||||||
.setDialogId(TIP_COLOR)
|
|
||||||
.show(requireActivity())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
llTipDividerColor.setOnClickListener {
|
|
||||||
context?.selector(items = ReadTipConfig.tipDividerColorNames) { _, i ->
|
|
||||||
when (i) {
|
|
||||||
0, 1 -> {
|
|
||||||
ReadTipConfig.tipDividerColor = i - 1
|
|
||||||
upTvTipDividerColor()
|
|
||||||
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
|
|
||||||
}
|
|
||||||
|
|
||||||
2 -> ColorPickerDialog.newBuilder()
|
|
||||||
.setShowAlphaSlider(false)
|
|
||||||
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
|
|
||||||
.setDialogId(TIP_DIVIDER_COLOR)
|
|
||||||
.show(requireActivity())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun clearRepeat(repeat: Int) = ReadTipConfig.apply {
|
|
||||||
if (repeat != none) {
|
|
||||||
if (tipHeaderLeft == repeat) {
|
|
||||||
tipHeaderLeft = none
|
|
||||||
binding.tvHeaderLeft.text = tipNames[none]
|
|
||||||
}
|
|
||||||
if (tipHeaderMiddle == repeat) {
|
|
||||||
tipHeaderMiddle = none
|
|
||||||
binding.tvHeaderMiddle.text = tipNames[none]
|
|
||||||
}
|
|
||||||
if (tipHeaderRight == repeat) {
|
|
||||||
tipHeaderRight = none
|
|
||||||
binding.tvHeaderRight.text = tipNames[none]
|
|
||||||
}
|
|
||||||
if (tipFooterLeft == repeat) {
|
|
||||||
tipFooterLeft = none
|
|
||||||
binding.tvFooterLeft.text = tipNames[none]
|
|
||||||
}
|
|
||||||
if (tipFooterMiddle == repeat) {
|
|
||||||
tipFooterMiddle = none
|
|
||||||
binding.tvFooterMiddle.text = tipNames[none]
|
|
||||||
}
|
|
||||||
if (tipFooterRight == repeat) {
|
|
||||||
tipFooterRight = none
|
|
||||||
binding.tvFooterRight.text = tipNames[none]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,10 +20,10 @@ class AccentColorButton @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setPaddingRelative(14.dpToPx(), 8.dpToPx(), 6.dpToPx(), 8.dpToPx())
|
setPaddingRelative(14.dpToPx(), 8.dpToPx(), 10.dpToPx(), 8.dpToPx())
|
||||||
iconGravity = ICON_GRAVITY_END
|
iconGravity = ICON_GRAVITY_END
|
||||||
iconPadding = 8.dpToPx()
|
iconPadding = 8.dpToPx()
|
||||||
iconSize = 28.dpToPx()
|
iconSize = 24.dpToPx()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createColorPreviewDrawable(color: Int): Drawable {
|
private fun createColorPreviewDrawable(color: Int): Drawable {
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
package io.legado.app.ui.widget
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.appcompat.widget.TooltipCompat
|
||||||
|
import io.legado.app.R
|
||||||
|
import io.legado.app.databinding.ViewSimpleSliderBinding
|
||||||
|
import io.legado.app.lib.dialogs.alert
|
||||||
|
|
||||||
|
@SuppressLint("ViewConstructor", "ClickableViewAccessibility")
|
||||||
|
class SimpleSliderView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet? = null
|
||||||
|
) : LinearLayout(context, attrs) {
|
||||||
|
|
||||||
|
private val binding = ViewSimpleSliderBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
|
private var _orientation: Int = 1
|
||||||
|
private var _progress = 0
|
||||||
|
private var _max = 100
|
||||||
|
private var _min = 0
|
||||||
|
private val isBottomBackground: Boolean
|
||||||
|
|
||||||
|
var valueFormat: ((Int) -> String)? = null
|
||||||
|
var onChanged: ((Int) -> Unit)? = null
|
||||||
|
|
||||||
|
private val handler = Handler(Looper.getMainLooper())
|
||||||
|
|
||||||
|
private val repeatInterval = 320L
|
||||||
|
|
||||||
|
private val tvTit: TextView
|
||||||
|
|
||||||
|
var progress: Int
|
||||||
|
get() = _progress
|
||||||
|
set(value) {
|
||||||
|
_progress = value.coerceIn(_min, _max)
|
||||||
|
updateValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
var max: Int
|
||||||
|
get() = _max
|
||||||
|
set(value) {
|
||||||
|
_max = value
|
||||||
|
_progress = _progress.coerceAtMost(_max)
|
||||||
|
updateValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
var min: Int
|
||||||
|
get() = _min
|
||||||
|
set(value) {
|
||||||
|
_min = value
|
||||||
|
_progress = _progress.coerceAtLeast(_min)
|
||||||
|
updateValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.DetailSeekBar)
|
||||||
|
isBottomBackground = typedArray.getBoolean(R.styleable.DetailSeekBar_isBottomBackground, false)
|
||||||
|
val title = typedArray.getText(R.styleable.DetailSeekBar_title)
|
||||||
|
_max = typedArray.getInt(R.styleable.DetailSeekBar_max, 100)
|
||||||
|
_min = typedArray.getInt(R.styleable.DetailSeekBar_min, 0)
|
||||||
|
_progress = _progress.coerceIn(_min, _max)
|
||||||
|
|
||||||
|
val ta = context.obtainStyledAttributes(attrs, R.styleable.SimpleCounterView)
|
||||||
|
_orientation = ta.getInt(R.styleable.SimpleCounterView_orientation, 1)
|
||||||
|
ta.recycle()
|
||||||
|
|
||||||
|
val slider = binding.slider
|
||||||
|
slider.valueFrom = _min.toFloat()
|
||||||
|
slider.valueTo = _max.toFloat()
|
||||||
|
slider.value = _progress.toFloat()
|
||||||
|
|
||||||
|
slider.addOnChangeListener { _, value, fromUser ->
|
||||||
|
if (fromUser) {
|
||||||
|
_progress = value.toInt()
|
||||||
|
updateValue()
|
||||||
|
onChanged?.invoke(_progress)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tvTit = binding.tvSeekTitleVertical
|
||||||
|
typedArray.recycle()
|
||||||
|
|
||||||
|
tvTit.text = title
|
||||||
|
TooltipCompat.setTooltipText(tvTit, title)
|
||||||
|
|
||||||
|
binding.tvSeekValue.setOnClickListener {
|
||||||
|
showSeekBarDialog()
|
||||||
|
}
|
||||||
|
|
||||||
|
updateValue()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showSeekBarDialog() {
|
||||||
|
context.alert(title = null, message = null) {
|
||||||
|
customView {
|
||||||
|
val detailSeekBar = DetailSeekBar(ctx).apply {
|
||||||
|
max = _max
|
||||||
|
min = _min
|
||||||
|
progress = _progress
|
||||||
|
valueFormat = this@SimpleSliderView.valueFormat
|
||||||
|
setTitle(tvTit.text)
|
||||||
|
onChanged = {
|
||||||
|
_progress = it
|
||||||
|
updateValue()
|
||||||
|
this@SimpleSliderView.onChanged?.invoke(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameLayout(ctx).apply {
|
||||||
|
setPadding(64, 0, 64, 0)
|
||||||
|
addView(detailSeekBar, LayoutParams(
|
||||||
|
LayoutParams.MATCH_PARENT,
|
||||||
|
LayoutParams.WRAP_CONTENT
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
okButton()
|
||||||
|
cancelButton()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateValue() {
|
||||||
|
binding.tvSeekValue.text = valueFormat?.invoke(_progress) ?: _progress.toString()
|
||||||
|
if (binding.slider.value.toInt() != _progress) {
|
||||||
|
binding.slider.value = _progress.toFloat()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private val incrementRunnable = object : Runnable {
|
||||||
|
override fun run() {
|
||||||
|
if (_progress < _max) {
|
||||||
|
_progress++
|
||||||
|
updateValue()
|
||||||
|
onChanged?.invoke(_progress)
|
||||||
|
handler.postDelayed(this, repeatInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val decrementRunnable = object : Runnable {
|
||||||
|
override fun run() {
|
||||||
|
if (_progress > _min) {
|
||||||
|
_progress--
|
||||||
|
updateValue()
|
||||||
|
onChanged?.invoke(_progress)
|
||||||
|
handler.postDelayed(this, repeatInterval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDetachedFromWindow() {
|
||||||
|
handler.removeCallbacks(incrementRunnable)
|
||||||
|
handler.removeCallbacks(decrementRunnable)
|
||||||
|
super.onDetachedFromWindow()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setEnabled(enabled: Boolean) {
|
||||||
|
super.setEnabled(enabled)
|
||||||
|
tvTit.isEnabled = enabled
|
||||||
|
binding.tvSeekValue.isEnabled = enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M120,840L120,120L200,120L200,840L120,840ZM760,840L760,120L840,120L840,840L760,840ZM280,520L280,440L360,440L360,520L280,520ZM440,520L440,440L520,440L520,520L440,520ZM600,520L600,440L680,440L680,520L600,520Z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M200,840L200,760L760,760L760,840L200,840ZM480,680Q379,680 323,617Q267,554 267,450L267,120L370,120L370,456Q370,512 398,547Q426,582 480,582Q534,582 562,547Q590,512 590,456L590,120L693,120L693,450Q693,554 637,617Q581,680 480,680Z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:startColor="?attr/colorSurfaceContainerLow"
|
||||||
|
android:endColor="@android:color/transparent"
|
||||||
|
android:angle="0" />
|
||||||
|
</shape>
|
||||||
@@ -5,96 +5,169 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:id="@+id/tool_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:theme="?attr/actionBarStyle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:text="@string/text_font"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical"
|
||||||
android:paddingStart="10dp"
|
android:gravity="center"
|
||||||
android:paddingEnd="10dp">
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButtonGroup
|
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical">
|
android:paddingVertical="16dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<TextView
|
||||||
android:id="@+id/btn_textItalic"
|
android:id="@+id/bottom_sheet_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
android:text="@string/text_font"
|
||||||
app:icon="@drawable/ic_format_italic"
|
android:textSize="18sp"
|
||||||
android:checkable="true"
|
android:textStyle="bold" />
|
||||||
android:focusable="true"/>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
</LinearLayout>
|
||||||
android:id="@+id/btn_textShadow"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
|
||||||
app:icon="@drawable/ic_shadow"
|
|
||||||
android:checkable="true"
|
|
||||||
android:focusable="true"/>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<TextView
|
||||||
android:id="@+id/textFontWeightConverter"
|
android:layout_width="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:minWidth="0dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:textSize="12sp" />
|
android:text="@string/text_typeface"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</com.google.android.material.button.MaterialButtonGroup>
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:gravity="end|center_vertical">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/btn_text_color"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/text_color" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/sw_underline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
app:icon="@drawable/ic_underline"
|
||||||
|
android:checkable="true"
|
||||||
|
android:focusable="true"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/sw_dottedline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
app:icon="@drawable/ic_dottedline"
|
||||||
|
android:checkable="true"
|
||||||
|
android:focusable="true"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_textItalic"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
app:icon="@drawable/ic_format_italic"
|
||||||
|
android:checkable="true"
|
||||||
|
android:focusable="true"/>
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="4dp"
|
||||||
|
android:gravity="end|center_vertical">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/btnShadowColor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/text_shadow_color" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_textShadow"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
app:icon="@drawable/ic_shadow"
|
||||||
|
android:checkable="true"
|
||||||
|
android:focusable="true"/>
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/textFontWeightConverter"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<com.google.android.material.slider.Slider
|
<com.google.android.material.slider.Slider
|
||||||
android:id="@+id/sliderFontWeight"
|
android:id="@+id/sliderFontWeight"
|
||||||
android:layout_width="0dp"
|
android:layout_width="160dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1" />
|
android:stepSize="1"
|
||||||
|
android:valueFrom="0"
|
||||||
|
android:valueTo="20"
|
||||||
|
app:thumbHeight="24dp"
|
||||||
|
app:trackHeight="24dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="@string/shadow_typeface"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:id="@+id/dsb_shadow_dx"
|
android:id="@+id/dsb_shadow_dx"
|
||||||
android:layout_width="120dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
android:layout_weight="1"
|
||||||
app:isBottomBackground="true"
|
app:isBottomBackground="true"
|
||||||
app:max="20"
|
app:max="20"
|
||||||
app:title="@string/text_shadow_x" />
|
app:title="@string/text_shadow_x" />
|
||||||
|
|
||||||
<View
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
|
||||||
android:id="@+id/dsb_shadow_dy"
|
android:id="@+id/dsb_shadow_dy"
|
||||||
android:layout_width="120dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
app:isBottomBackground="true"
|
app:isBottomBackground="true"
|
||||||
app:max="20"
|
app:max="20"
|
||||||
app:title="@string/text_shadow_y" />
|
app:title="@string/text_shadow_y" />
|
||||||
@@ -106,27 +179,23 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="bottom">
|
android:gravity="bottom">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:id="@+id/dsb_shadow_radius"
|
android:id="@+id/dsb_shadow_radius"
|
||||||
android:layout_width="120dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginEnd="32dp"
|
||||||
|
android:layout_weight="1"
|
||||||
app:isBottomBackground="true"
|
app:isBottomBackground="true"
|
||||||
app:max="50"
|
app:max="50"
|
||||||
app:title="@string/text_shadow_radius" />
|
app:title="@string/text_shadow_radius" />
|
||||||
|
|
||||||
<View
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
|
android:id="@+id/btn_indent_layout"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/btnShadowColor"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
android:layout_weight="1"
|
||||||
android:text="@string/text_shadow_color" />
|
app:title="@string/text_indent"
|
||||||
|
app:max="4" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -134,104 +203,40 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/textInputIndentLayout"
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:layout_width="120dp"
|
android:id="@+id/dsb_paragraph_spacing"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="32dp"
|
||||||
style="@style/Widget.Material3.TextInputLayout.FilledBox.Dense.ExposedDropdownMenu"
|
android:layout_weight="1"
|
||||||
android:hint="@string/text_indent">
|
app:max="20"
|
||||||
|
app:isBottomBackground="true"
|
||||||
|
app:title="@string/paragraph_size" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.MaterialAutoCompleteTextView
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:id="@+id/textIndentDropdown"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="none"
|
|
||||||
android:focusable="false"
|
|
||||||
android:clickable="true" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/paragraph_size"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cardBackgroundColor="?attr/colorSurfaceContainer"
|
|
||||||
app:cardCornerRadius="4dp"
|
|
||||||
app:strokeWidth="0dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textParagraphSpacing"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingHorizontal="4dp"
|
|
||||||
android:paddingVertical="2dp"
|
|
||||||
android:text="@string/text"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.slider.Slider
|
|
||||||
android:id="@+id/dsb_paragraph_spacing"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:stepSize="1"
|
|
||||||
android:valueFrom="0"
|
|
||||||
android:valueTo="20"
|
|
||||||
app:isBottomBackground="true"
|
|
||||||
app:thumbHeight="24dp"
|
|
||||||
app:title="@string/paragraph_size"
|
|
||||||
app:trackHeight="24dp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginVertical="8dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
|
||||||
android:id="@+id/dsb_line_size"
|
android:id="@+id/dsb_line_size"
|
||||||
android:layout_width="120dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
app:isBottomBackground="true"
|
app:isBottomBackground="true"
|
||||||
app:max="20"
|
app:max="20"
|
||||||
app:title="@string/line_size" />
|
app:title="@string/line_size" />
|
||||||
|
|
||||||
<View
|
</LinearLayout>
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.SimpleSliderView
|
||||||
android:id="@+id/dsb_text_letter_spacing"
|
android:id="@+id/dsb_text_letter_spacing"
|
||||||
android:layout_width="120dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
app:isBottomBackground="true"
|
app:isBottomBackground="true"
|
||||||
app:max="100"
|
app:max="100"
|
||||||
app:title="@string/text_letter_spacing" />
|
app:title="@string/text_letter_spacing" />
|
||||||
@@ -239,6 +244,36 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="@string/select_font"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_default_fonts"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/default_font"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_other_dir"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/other_folder"/>
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -127,22 +127,6 @@
|
|||||||
android:text="@string/dark_status_icon"
|
android:text="@string/dark_status_icon"
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/sw_underline"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="6dp"
|
|
||||||
android:text="@string/text_underline"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
|
||||||
android:id="@+id/sw_dottedline"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="6dp"
|
|
||||||
android:text="@string/text_dottedline"
|
|
||||||
tools:ignore="TouchTargetSizeCheck" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -177,18 +161,6 @@
|
|||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/tv_text_color"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
app:icon="@drawable/ic_palette"
|
|
||||||
android:text="@string/text_color"
|
|
||||||
android:textSize="14sp"
|
|
||||||
app:cornerRadius="12dp" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/tv_bg_color"
|
android:id="@+id/tv_bg_color"
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="4dp"
|
||||||
android:paddingHorizontal="16dp">
|
android:paddingHorizontal="16dp">
|
||||||
|
|
||||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingVertical="16dp"
|
android:paddingVertical="8dp"
|
||||||
android:minHeight="0dp"
|
android:minHeight="0dp"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
<io.legado.app.ui.widget.SimpleCounterView
|
<io.legado.app.ui.widget.SimpleCounterView
|
||||||
android:id="@+id/dsb_text_size"
|
android:id="@+id/dsb_text_size"
|
||||||
android:layout_width="140dp"
|
android:layout_width="128dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -229,30 +229,41 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_bg_ts"
|
android:id="@+id/tv_bg_ts"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/text_bg_style"
|
android:text="@string/text_bg_style"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:alpha="0.6"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:textColor="?attr/colorOnSurfaceVariant"
|
||||||
|
android:text="@string/long_click_to_custom"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tool:ignore="SmallSp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="16dp">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/cb_share_layout"
|
android:id="@+id/cb_share_layout"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="56dp"
|
android:layout_height="44dp"
|
||||||
app:cornerRadius="16dp"
|
app:cornerRadius="8dp"
|
||||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
@@ -260,21 +271,33 @@
|
|||||||
app:icon="@drawable/ic_share_layout"
|
app:icon="@drawable/ic_share_layout"
|
||||||
app:iconGravity="textStart"
|
app:iconGravity="textStart"
|
||||||
app:iconPadding="0dp"
|
app:iconPadding="0dp"
|
||||||
android:layout_marginStart="16dp"/>
|
android:layout_marginStart="16dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_style"
|
android:id="@+id/rv_style"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:paddingHorizontal="8dp"
|
android:paddingHorizontal="8dp"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
tool:listitem="@layout/item_read_style" />
|
tool:listitem="@layout/item_read_style"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/cb_share_layout"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/cb_share_layout"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:src="@drawable/left_fade"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,276 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingHorizontal="16dp">
|
||||||
|
|
||||||
|
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
android:minHeight="0dp"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/bottom_sheet_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/header_footer"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:text="@string/global_setting"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end"
|
||||||
|
app:overflowMode="wrap">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/btn_padding_setting"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/padding"/>
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/btn_tip_color"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/text_color" />
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/btn_divider_color"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/tip_divider_color" />
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_header_show"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_header_padding"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/header"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/btn_header_mode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:text="@string/header" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_header_left"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/left" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_header_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_header_middle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/middle" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_header_middle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_header_right"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/right" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_header_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_footer_show"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/footer"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/btn_footer_mode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:text="@string/footer" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_footer_left"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/left" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_footer_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_footer_middle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/middle" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_footer_middle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_footer_right"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/right" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_footer_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:layout_gravity="end|bottom"
|
||||||
|
tools:text="@string/title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -45,8 +45,9 @@
|
|||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/rg_title_mode"
|
android:id="@+id/rg_title_mode"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
app:singleLine="true"
|
app:singleLine="true"
|
||||||
app:singleSelection="true"
|
app:singleSelection="true"
|
||||||
app:selectionRequired="true">
|
app:selectionRequired="true">
|
||||||
@@ -78,7 +79,7 @@
|
|||||||
<com.google.android.material.button.MaterialButtonGroup
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="bottom">
|
android:gravity="end">
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/btn_title_segType"
|
android:id="@+id/btn_title_segType"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -166,278 +167,19 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_header_show"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_header_padding"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/header"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
|
||||||
android:id="@+id/chip_header_mode"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
app:selectionRequired="true"
|
|
||||||
app:singleSelection="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_header_left"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/left" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_header_left"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_header_middle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/middle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_header_middle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_header_right"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/right" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_header_right"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_footer_show"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/footer"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
|
||||||
android:id="@+id/chip_footer_mode"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:selectionRequired="true"
|
|
||||||
app:singleSelection="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_footer_left"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/left" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_footer_left"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_footer_middle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/middle" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_footer_middle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_footer_right"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/right" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_footer_right"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/title" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/header_footer"
|
android:text="工具栏样式"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_tip_color"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/text_color" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_tip_color"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/text_color" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_tip_divider_color"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingVertical="4dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@string/tip_divider_color" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_tip_divider_color"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="@string/tip_divider_color" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.AccentColorButton
|
|
||||||
android:id="@+id/abtnBackgroundColor"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
|
||||||
android:text="@string/background_color" />
|
|
||||||
|
|
||||||
<io.legado.app.ui.widget.AccentColorButton
|
|
||||||
android:id="@+id/abtnAccentColor"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
|
||||||
android:text="@string/accent" />
|
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/bottom_mode"
|
android:id="@+id/bottom_mode"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
app:singleLine="true"
|
app:singleLine="true"
|
||||||
app:singleSelection="true"
|
app:singleSelection="true"
|
||||||
app:selectionRequired="true">
|
app:selectionRequired="true">
|
||||||
@@ -463,9 +205,29 @@
|
|||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
android:text="@string/custom" />
|
android:text="@string/custom" />
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.chip.ChipGroup>
|
</com.google.android.material.chip.ChipGroup>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButtonGroup
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="end">
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/abtnBackgroundColor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/background_color" />
|
||||||
|
|
||||||
|
<io.legado.app.ui.widget.AccentColorButton
|
||||||
|
android:id="@+id/abtnAccentColor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Widget.Material3Expressive.Button.OutlinedButton"
|
||||||
|
android:text="@string/accent" />
|
||||||
|
|
||||||
|
</com.google.android.material.button.MaterialButtonGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
@@ -9,7 +9,8 @@
|
|||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/cd_style"
|
android:id="@+id/cd_style"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="36dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
app:strokeColor="?attr/colorOutlineVariant"
|
app:strokeColor="?attr/colorOutlineVariant"
|
||||||
app:strokeWidth="2dp"
|
app:strokeWidth="2dp"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
@@ -25,6 +26,9 @@
|
|||||||
android:id="@+id/tv_style"
|
android:id="@+id/tv_style"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
android:autoSizeMaxTextSize="12sp"
|
android:autoSizeMaxTextSize="12sp"
|
||||||
android:autoSizeMinTextSize="6sp"
|
android:autoSizeMinTextSize="6sp"
|
||||||
android:autoSizeStepGranularity="1sp"
|
android:autoSizeStepGranularity="1sp"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_marginVertical="8dp"
|
android:layout_marginVertical="8dp"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="8dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:strokeWidth="0dp"
|
app:strokeWidth="0dp"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
android:id="@+id/battery_text"
|
android:id="@+id/battery_text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="0.1dp"
|
android:includeFontPadding="false"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
@@ -85,6 +85,7 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:includeFontPadding="false"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:textSize="11sp"
|
android:textSize="11sp"
|
||||||
android:text="@string/text"
|
android:text="@string/text"
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSeekTitleVertical"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:text="@string/text"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:strokeWidth="0dp"
|
||||||
|
app:cardBackgroundColor="?attr/colorSecondaryContainer">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSeekValue"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="4dp"
|
||||||
|
android:layout_marginVertical="2dp"
|
||||||
|
android:text="@string/text"
|
||||||
|
android:textColor="?attr/colorSecondary"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.slider.Slider
|
||||||
|
android:id="@+id/slider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:stepSize="1"
|
||||||
|
app:thumbStrokeWidth="4dp"
|
||||||
|
app:thumbStrokeColor="?attr/colorSecondary"
|
||||||
|
app:thumbTrackGapSize="0dp"
|
||||||
|
app:thumbWidth="24dp"
|
||||||
|
app:thumbColor="?attr/colorSurface"
|
||||||
|
app:tickColorActive="@android:color/transparent"
|
||||||
|
app:tickColorInactive="@android:color/transparent"
|
||||||
|
app:trackColorActive="?attr/colorSecondary"
|
||||||
|
app:trackColorInactive="?attr/colorSurfaceContainerHighest"
|
||||||
|
android:valueFrom="0"
|
||||||
|
android:valueTo="20"
|
||||||
|
app:thumbHeight="24dp"
|
||||||
|
app:trackHeight="24dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_default"
|
|
||||||
android:title="@string/default_font"
|
|
||||||
app:showAsAction="ifRoom" />
|
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_other"
|
|
||||||
android:title="@string/other_folder"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
</menu>
|
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="tip_color">
|
<string-array name="tip_color">
|
||||||
<item>跟随内容</item>
|
<item>跟随正文字体颜色</item>
|
||||||
<item>自定义</item>
|
<item>自定义</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,7 @@
|
|||||||
<string name="copy_text">拷贝内容</string>
|
<string name="copy_text">拷贝内容</string>
|
||||||
<string name="download_all">一键缓存</string>
|
<string name="download_all">一键缓存</string>
|
||||||
<string name="content_sl">这是一段测试文字\n\u3000\u3000只是让你看看效果的</string>
|
<string name="content_sl">这是一段测试文字\n\u3000\u3000只是让你看看效果的</string>
|
||||||
<string name="text_bg_style">文字颜色和背景(长按自定义)</string>
|
<string name="text_bg_style">背景</string>
|
||||||
<string name="immersion_status_bar">沉浸式状态栏</string>
|
<string name="immersion_status_bar">沉浸式状态栏</string>
|
||||||
<string name="un_download">还剩 %d 章未下载</string>
|
<string name="un_download">还剩 %d 章未下载</string>
|
||||||
<string name="long_click_input_color">长按输入颜色值</string>
|
<string name="long_click_input_color">长按输入颜色值</string>
|
||||||
@@ -817,7 +817,7 @@
|
|||||||
<string name="non_action">无操作</string>
|
<string name="non_action">无操作</string>
|
||||||
<string name="body_title">正文标题</string>
|
<string name="body_title">正文标题</string>
|
||||||
<string name="show_hide">显示/隐藏</string>
|
<string name="show_hide">显示/隐藏</string>
|
||||||
<string name="header_footer">页眉<![CDATA[&]]>页脚</string>
|
<string name="header_footer">页眉与页脚</string>
|
||||||
<string name="rule_subscription">规则订阅</string>
|
<string name="rule_subscription">规则订阅</string>
|
||||||
<string name="rule_sub_empty_msg">添加大佬们提供的规则导入地址\n添加后点击可导入规则</string>
|
<string name="rule_sub_empty_msg">添加大佬们提供的规则导入地址\n添加后点击可导入规则</string>
|
||||||
<string name="get_book_progress">拉取云端进度</string>
|
<string name="get_book_progress">拉取云端进度</string>
|
||||||
@@ -1331,4 +1331,8 @@
|
|||||||
<string name="coll_volume">折叠所有卷</string>
|
<string name="coll_volume">折叠所有卷</string>
|
||||||
<string name="expand_volume">展开所有卷</string>
|
<string name="expand_volume">展开所有卷</string>
|
||||||
<string name="custom">自定义</string>
|
<string name="custom">自定义</string>
|
||||||
|
<string name="global_setting">全局设置</string>
|
||||||
|
<string name="text_typeface">字体样式</string>
|
||||||
|
<string name="shadow_typeface">阴影样式</string>
|
||||||
|
<string name="long_click_to_custom">长按自定义</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1332,4 +1332,8 @@
|
|||||||
<string name="coll_volume">折叠所有卷</string>
|
<string name="coll_volume">折叠所有卷</string>
|
||||||
<string name="expand_volume">展开所有卷</string>
|
<string name="expand_volume">展开所有卷</string>
|
||||||
<string name="custom">自定义</string>
|
<string name="custom">自定义</string>
|
||||||
|
<string name="global_setting">全局设置</string>
|
||||||
|
<string name="text_typeface">字体样式</string>
|
||||||
|
<string name="shadow_typeface">阴影样式</string>
|
||||||
|
<string name="long_click_to_custom">长按自定义</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user