优化封面

pull/1336/head
gedoor 3 years ago
parent 4cb8898793
commit 94e5065677
  1. 1
      app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt
  2. 62
      app/src/main/java/io/legado/app/ui/config/ConfigActivity.kt
  3. 10
      app/src/main/java/io/legado/app/ui/config/ConfigTag.kt
  4. 15
      app/src/main/java/io/legado/app/ui/config/ConfigViewModel.kt
  5. 119
      app/src/main/java/io/legado/app/ui/config/CoverConfigFragment.kt
  6. 1
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  7. 60
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  8. 8
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt
  9. 11
      app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt
  10. BIN
      app/src/main/res/drawable/image_cover_default.png
  11. 2
      app/src/main/res/values-es-rES/strings.xml
  12. 2
      app/src/main/res/values-ja-rJP/strings.xml
  13. 2
      app/src/main/res/values-pt-rBR/strings.xml
  14. 2
      app/src/main/res/values-zh-rHK/strings.xml
  15. 2
      app/src/main/res/values-zh-rTW/strings.xml
  16. 2
      app/src/main/res/values-zh/strings.xml
  17. 2
      app/src/main/res/values/strings.xml
  18. 49
      app/src/main/res/xml/pref_config_cover.xml
  19. 16
      app/src/main/res/xml/pref_config_theme.xml

@ -122,6 +122,7 @@ class BackupConfigFragment : BasePreferenceFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
activity?.setTitle(R.string.backup_restore)
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
ATH.applyEdgeEffectColor(listView) ATH.applyEdgeEffectColor(listView)
setHasOptionsMenu(true) setHasOptionsMenu(true)

@ -1,56 +1,41 @@
package io.legado.app.ui.config package io.legado.app.ui.config
import android.os.Bundle import android.os.Bundle
import androidx.activity.viewModels import androidx.fragment.app.Fragment
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.BaseActivity
import io.legado.app.constant.EventBus import io.legado.app.constant.EventBus
import io.legado.app.databinding.ActivityConfigBinding import io.legado.app.databinding.ActivityConfigBinding
import io.legado.app.utils.observeEvent import io.legado.app.utils.observeEvent
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
class ConfigActivity : VMBaseActivity<ActivityConfigBinding, ConfigViewModel>() { class ConfigActivity : BaseActivity<ActivityConfigBinding>() {
override val binding by viewBinding(ActivityConfigBinding::inflate) override val binding by viewBinding(ActivityConfigBinding::inflate)
override val viewModel by viewModels<ConfigViewModel>()
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
intent.getIntExtra("configType", -1).let { when (val configTag = intent.getStringExtra("configTag")) {
if (it != -1) viewModel.configType = it ConfigTag.OTHER_CONFIG -> replaceFragment<OtherConfigFragment>(configTag)
ConfigTag.THEME_CONFIG -> replaceFragment<ThemeConfigFragment>(configTag)
ConfigTag.BACKUP_CONFIG -> replaceFragment<BackupConfigFragment>(configTag)
ConfigTag.COVER_CONFIG -> replaceFragment<CoverConfigFragment>(configTag)
else -> finish()
} }
when (viewModel.configType) {
ConfigViewModel.TYPE_CONFIG -> {
binding.titleBar.title = getString(R.string.other_setting)
val fTag = "otherConfigFragment"
var configFragment = supportFragmentManager.findFragmentByTag(fTag)
if (configFragment == null) configFragment = OtherConfigFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.configFrameLayout, configFragment, fTag)
.commit()
} }
ConfigViewModel.TYPE_THEME_CONFIG -> {
binding.titleBar.title = getString(R.string.theme_setting) override fun setTitle(resId: Int) {
val fTag = "themeConfigFragment" super.setTitle(resId)
var configFragment = supportFragmentManager.findFragmentByTag(fTag) binding.titleBar.setTitle(resId)
if (configFragment == null) configFragment = ThemeConfigFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.configFrameLayout, configFragment, fTag)
.commit()
} }
ConfigViewModel.TYPE_WEB_DAV_CONFIG -> {
binding.titleBar.title = getString(R.string.backup_restore) inline fun <reified T : Fragment> replaceFragment(configTag: String) {
val fTag = "backupConfigFragment" intent.putExtra("configTag", configTag)
var configFragment = supportFragmentManager.findFragmentByTag(fTag) val configFragment = supportFragmentManager.findFragmentByTag(configTag)
if (configFragment == null) configFragment = BackupConfigFragment() ?: T::class.java.newInstance()
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.replace(R.id.configFrameLayout, configFragment, fTag) .replace(R.id.configFrameLayout, configFragment, configTag)
.commit() .commit()
} }
}
}
override fun observeLiveBus() { override fun observeLiveBus() {
super.observeLiveBus() super.observeLiveBus()
@ -58,4 +43,13 @@ class ConfigActivity : VMBaseActivity<ActivityConfigBinding, ConfigViewModel>()
recreate() recreate()
} }
} }
override fun finish() {
if (supportFragmentManager.findFragmentByTag(ConfigTag.COVER_CONFIG) != null) {
replaceFragment<ThemeConfigFragment>(ConfigTag.THEME_CONFIG)
} else {
super.finish()
}
}
} }

@ -0,0 +1,10 @@
package io.legado.app.ui.config
object ConfigTag {
const val OTHER_CONFIG = "otherConfig"
const val THEME_CONFIG = "themeConfig"
const val BACKUP_CONFIG = "backupConfig"
const val COVER_CONFIG = "coverConfig"
}

@ -1,15 +0,0 @@
package io.legado.app.ui.config
import android.app.Application
import androidx.lifecycle.AndroidViewModel
class ConfigViewModel(application: Application) : AndroidViewModel(application) {
companion object {
const val TYPE_CONFIG = 0
const val TYPE_THEME_CONFIG = 1
const val TYPE_WEB_DAV_CONFIG = 2
}
var configType: Int = TYPE_CONFIG
}

@ -0,0 +1,119 @@
package io.legado.app.ui.config
import android.annotation.SuppressLint
import android.content.SharedPreferences
import android.net.Uri
import android.os.Bundle
import android.view.View
import androidx.preference.Preference
import io.legado.app.R
import io.legado.app.base.BasePreferenceFragment
import io.legado.app.constant.PreferKey
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.widget.image.CoverImageView
import io.legado.app.utils.*
class CoverConfigFragment : BasePreferenceFragment(),
SharedPreferences.OnSharedPreferenceChangeListener {
private val requestCodeCover = 111
private val requestCodeCoverDark = 112
private val selectImage = registerForActivityResult(SelectImageContract()) {
val uri = it?.second ?: return@registerForActivityResult
when (it.first) {
requestCodeCover -> setCoverFromUri(PreferKey.defaultCover, uri)
requestCodeCoverDark -> setCoverFromUri(PreferKey.defaultCoverDark, uri)
}
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_config_cover)
upPreferenceSummary(PreferKey.defaultCover, getPrefString(PreferKey.defaultCover))
upPreferenceSummary(PreferKey.defaultCoverDark, getPrefString(PreferKey.defaultCoverDark))
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
activity?.setTitle(R.string.cover_config)
ATH.applyEdgeEffectColor(listView)
setHasOptionsMenu(true)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
}
override fun onDestroy() {
super.onDestroy()
preferenceManager.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
sharedPreferences ?: return
when (key) {
PreferKey.defaultCover,
PreferKey.defaultCoverDark -> {
upPreferenceSummary(key, getPrefString(key))
}
}
}
@SuppressLint("PrivateResource")
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
when (val key = preference?.key) {
PreferKey.defaultCover ->
if (getPrefString(PreferKey.defaultCover).isNullOrEmpty()) {
selectImage.launch(requestCodeCover)
} else {
context?.selector(items = arrayListOf("删除图片", "选择图片")) { _, i ->
if (i == 0) {
removePref(PreferKey.defaultCover)
CoverImageView.upDefaultCover()
} else {
selectImage.launch(requestCodeCover)
}
}
}
PreferKey.defaultCoverDark ->
if (getPrefString(PreferKey.defaultCoverDark).isNullOrEmpty()) {
selectImage.launch(requestCodeCoverDark)
} else {
context?.selector(items = arrayListOf("删除图片", "选择图片")) { _, i ->
if (i == 0) {
removePref(PreferKey.defaultCoverDark)
CoverImageView.upDefaultCover()
} else {
selectImage.launch(requestCodeCoverDark)
}
}
}
}
return super.onPreferenceTreeClick(preference)
}
private fun upPreferenceSummary(preferenceKey: String, value: String?) {
val preference = findPreference<Preference>(preferenceKey) ?: return
when (preferenceKey) {
PreferKey.defaultCover,
PreferKey.defaultCoverDark -> preference.summary = if (value.isNullOrBlank()) {
getString(R.string.select_image)
} else {
value
}
else -> preference.summary = value
}
}
private fun setCoverFromUri(preferenceKey: String, uri: Uri) {
readUri(uri) { name, bytes ->
var file = requireContext().externalFiles
file = FileUtils.createFileIfNotExist(file, "covers", name)
file.writeBytes(bytes)
putPrefString(preferenceKey, file.absolutePath)
CoverImageView.upDefaultCover()
}
}
}

@ -48,6 +48,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
activity?.setTitle(R.string.other_setting)
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this)
ATH.applyEdgeEffectColor(listView) ATH.applyEdgeEffectColor(listView)
} }

@ -24,7 +24,6 @@ import io.legado.app.help.ThemeConfig
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.selector import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.ui.widget.image.CoverImageView
import io.legado.app.ui.widget.number.NumberPickerDialog import io.legado.app.ui.widget.number.NumberPickerDialog
import io.legado.app.ui.widget.prefs.ColorPreference import io.legado.app.ui.widget.prefs.ColorPreference
import io.legado.app.ui.widget.seekbar.SeekBarChangeListener import io.legado.app.ui.widget.seekbar.SeekBarChangeListener
@ -34,15 +33,12 @@ import io.legado.app.utils.*
@Suppress("SameParameterValue") @Suppress("SameParameterValue")
class ThemeConfigFragment : BasePreferenceFragment(), class ThemeConfigFragment : BasePreferenceFragment(),
SharedPreferences.OnSharedPreferenceChangeListener { SharedPreferences.OnSharedPreferenceChangeListener {
private val requestCodeCover = 111
private val requestCodeCoverDark = 112
private val requestCodeBgLight = 121 private val requestCodeBgLight = 121
private val requestCodeBgDark = 122 private val requestCodeBgDark = 122
private val selectImage = registerForActivityResult(SelectImageContract()) { private val selectImage = registerForActivityResult(SelectImageContract()) {
val uri = it?.second ?: return@registerForActivityResult val uri = it?.second ?: return@registerForActivityResult
when (it.first) { when (it.first) {
requestCodeCover -> setCoverFromUri(PreferKey.defaultCover, uri)
requestCodeCoverDark -> setCoverFromUri(PreferKey.defaultCoverDark, uri)
requestCodeBgLight -> setBgFromUri(uri, PreferKey.bgImage) { requestCodeBgLight -> setBgFromUri(uri, PreferKey.bgImage) {
upTheme(false) upTheme(false)
} }
@ -60,8 +56,6 @@ class ThemeConfigFragment : BasePreferenceFragment(),
upPreferenceSummary(PreferKey.bgImage, getPrefString(PreferKey.bgImage)) upPreferenceSummary(PreferKey.bgImage, getPrefString(PreferKey.bgImage))
upPreferenceSummary(PreferKey.bgImageN, getPrefString(PreferKey.bgImageN)) upPreferenceSummary(PreferKey.bgImageN, getPrefString(PreferKey.bgImageN))
upPreferenceSummary(PreferKey.barElevation, AppConfig.elevation.toString()) upPreferenceSummary(PreferKey.barElevation, AppConfig.elevation.toString())
upPreferenceSummary(PreferKey.defaultCover, getPrefString(PreferKey.defaultCover))
upPreferenceSummary(PreferKey.defaultCoverDark, getPrefString(PreferKey.defaultCoverDark))
findPreference<ColorPreference>(PreferKey.cBackground)?.let { findPreference<ColorPreference>(PreferKey.cBackground)?.let {
it.onSaveColor = { color -> it.onSaveColor = { color ->
if (!ColorUtils.isColorLight(color)) { if (!ColorUtils.isColorLight(color)) {
@ -86,6 +80,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
activity?.setTitle(R.string.theme_setting)
ATH.applyEdgeEffectColor(listView) ATH.applyEdgeEffectColor(listView)
setHasOptionsMenu(true) setHasOptionsMenu(true)
} }
@ -134,9 +129,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
upTheme(true) upTheme(true)
} }
PreferKey.bgImage, PreferKey.bgImage,
PreferKey.bgImageN, PreferKey.bgImageN -> {
PreferKey.defaultCover,
PreferKey.defaultCoverDark -> {
upPreferenceSummary(key, getPrefString(key)) upPreferenceSummary(key, getPrefString(key))
} }
} }
@ -159,36 +152,13 @@ class ThemeConfigFragment : BasePreferenceFragment(),
AppConfig.elevation = it AppConfig.elevation = it
recreateActivities() recreateActivities()
} }
"themeList" -> ThemeListDialog().show(childFragmentManager, "themeList")
"saveDayTheme", "saveNightTheme" -> alertSaveTheme(key)
PreferKey.bgImage -> selectBgAction(false) PreferKey.bgImage -> selectBgAction(false)
PreferKey.bgImageN -> selectBgAction(true) PreferKey.bgImageN -> selectBgAction(true)
PreferKey.defaultCover -> "themeList" -> ThemeListDialog().show(childFragmentManager, "themeList")
if (getPrefString(PreferKey.defaultCover).isNullOrEmpty()) { "saveDayTheme",
selectImage.launch(requestCodeCover) "saveNightTheme" -> alertSaveTheme(key)
} else { "coverConfig" -> (activity as? ConfigActivity)
context?.selector(items = arrayListOf("删除图片", "选择图片")) { _, i -> ?.replaceFragment<CoverConfigFragment>(ConfigTag.COVER_CONFIG)
if (i == 0) {
removePref(PreferKey.defaultCover)
CoverImageView.upDefaultCover()
} else {
selectImage.launch(requestCodeCover)
}
}
}
PreferKey.defaultCoverDark ->
if (getPrefString(PreferKey.defaultCoverDark).isNullOrEmpty()) {
selectImage.launch(requestCodeCoverDark)
} else {
context?.selector(items = arrayListOf("删除图片", "选择图片")) { _, i ->
if (i == 0) {
removePref(PreferKey.defaultCoverDark)
CoverImageView.upDefaultCover()
} else {
selectImage.launch(requestCodeCoverDark)
}
}
}
} }
return super.onPreferenceTreeClick(preference) return super.onPreferenceTreeClick(preference)
} }
@ -293,9 +263,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
PreferKey.barElevation -> preference.summary = PreferKey.barElevation -> preference.summary =
getString(R.string.bar_elevation_s, value) getString(R.string.bar_elevation_s, value)
PreferKey.bgImage, PreferKey.bgImage,
PreferKey.bgImageN, PreferKey.bgImageN -> preference.summary = if (value.isNullOrBlank()) {
PreferKey.defaultCover,
PreferKey.defaultCoverDark -> preference.summary = if (value.isNullOrBlank()) {
getString(R.string.select_image) getString(R.string.select_image)
} else { } else {
value value
@ -314,14 +282,4 @@ class ThemeConfigFragment : BasePreferenceFragment(),
} }
} }
private fun setCoverFromUri(preferenceKey: String, uri: Uri) {
readUri(uri) { name, bytes ->
var file = requireContext().externalFiles
file = FileUtils.createFileIfNotExist(file, "covers", name)
file.writeBytes(bytes)
putPrefString(preferenceKey, file.absolutePath)
CoverImageView.upDefaultCover()
}
}
} }

@ -21,7 +21,7 @@ import io.legado.app.ui.about.DonateActivity
import io.legado.app.ui.about.ReadRecordActivity import io.legado.app.ui.about.ReadRecordActivity
import io.legado.app.ui.book.source.manage.BookSourceActivity import io.legado.app.ui.book.source.manage.BookSourceActivity
import io.legado.app.ui.config.ConfigActivity import io.legado.app.ui.config.ConfigActivity
import io.legado.app.ui.config.ConfigViewModel import io.legado.app.ui.config.ConfigTag
import io.legado.app.ui.replace.ReplaceRuleActivity import io.legado.app.ui.replace.ReplaceRuleActivity
import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.ui.widget.prefs.NameListPreference import io.legado.app.ui.widget.prefs.NameListPreference
@ -128,13 +128,13 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config) {
"bookSourceManage" -> startActivity<BookSourceActivity>() "bookSourceManage" -> startActivity<BookSourceActivity>()
"replaceManage" -> startActivity<ReplaceRuleActivity>() "replaceManage" -> startActivity<ReplaceRuleActivity>()
"setting" -> startActivity<ConfigActivity> { "setting" -> startActivity<ConfigActivity> {
putExtra("configType", ConfigViewModel.TYPE_CONFIG) putExtra("configTag", ConfigTag.OTHER_CONFIG)
} }
"web_dav_setting" -> startActivity<ConfigActivity> { "web_dav_setting" -> startActivity<ConfigActivity> {
putExtra("configType", ConfigViewModel.TYPE_WEB_DAV_CONFIG) putExtra("configTag", ConfigTag.BACKUP_CONFIG)
} }
"theme_setting" -> startActivity<ConfigActivity> { "theme_setting" -> startActivity<ConfigActivity> {
putExtra("configType", ConfigViewModel.TYPE_THEME_CONFIG) putExtra("configTag", ConfigTag.THEME_CONFIG)
} }
"readRecord" -> startActivity<ReadRecordActivity>() "readRecord" -> startActivity<ReadRecordActivity>()
"donate" -> startActivity<DonateActivity>() "donate" -> startActivity<DonateActivity>()

@ -14,6 +14,7 @@ import io.legado.app.R
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig import io.legado.app.help.AppConfig
import io.legado.app.help.glide.ImageLoader import io.legado.app.help.glide.ImageLoader
import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.getPrefBoolean import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.getPrefString import io.legado.app.utils.getPrefString
import io.legado.app.utils.textHeight import io.legado.app.utils.textHeight
@ -91,7 +92,7 @@ class CoverImageView @JvmOverloads constructor(
canvas.clipPath(filletPath) canvas.clipPath(filletPath)
} }
super.onDraw(canvas) super.onDraw(canvas)
if (defaultCover && drawBookName) { if (defaultCover && drawBookName && !isInEditMode) {
drawName(canvas) drawName(canvas)
} }
} }
@ -101,12 +102,12 @@ class CoverImageView @JvmOverloads constructor(
var startY = height * 0.2f var startY = height * 0.2f
name?.toStringArray()?.let { name -> name?.toStringArray()?.let { name ->
namePaint.textSize = width / 7 namePaint.textSize = width / 7
namePaint.strokeWidth = namePaint.textSize / 10 namePaint.strokeWidth = namePaint.textSize / 5
name.forEach { name.forEach {
namePaint.color = Color.WHITE namePaint.color = Color.WHITE
namePaint.style = Paint.Style.STROKE namePaint.style = Paint.Style.STROKE
canvas.drawText(it, startX, startY, namePaint) canvas.drawText(it, startX, startY, namePaint)
namePaint.color = Color.DKGRAY namePaint.color = context.accentColor
namePaint.style = Paint.Style.FILL namePaint.style = Paint.Style.FILL
canvas.drawText(it, startX, startY, namePaint) canvas.drawText(it, startX, startY, namePaint)
startY += namePaint.textHeight startY += namePaint.textHeight
@ -119,12 +120,12 @@ class CoverImageView @JvmOverloads constructor(
startX = width * 0.8f startX = width * 0.8f
startY = height * 0.7f startY = height * 0.7f
authorPaint.textSize = width / 9 authorPaint.textSize = width / 9
authorPaint.strokeWidth = authorPaint.textSize / 10 authorPaint.strokeWidth = authorPaint.textSize / 5
author.forEach { author.forEach {
authorPaint.color = Color.WHITE authorPaint.color = Color.WHITE
authorPaint.style = Paint.Style.STROKE authorPaint.style = Paint.Style.STROKE
canvas.drawText(it, startX, startY, authorPaint) canvas.drawText(it, startX, startY, authorPaint)
authorPaint.color = Color.DKGRAY authorPaint.color = context.accentColor
authorPaint.style = Paint.Style.FILL authorPaint.style = Paint.Style.FILL
canvas.drawText(it, startX, startY, authorPaint) canvas.drawText(it, startX, startY, authorPaint)
startY += authorPaint.textHeight startY += authorPaint.textHeight

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

@ -874,5 +874,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -878,5 +878,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -878,5 +878,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -875,5 +875,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -877,5 +877,7 @@
<string name="set_source_variable">設定源變數</string> <string name="set_source_variable">設定源變數</string>
<string name="set_book_variable">設定書籍變數</string> <string name="set_book_variable">設定書籍變數</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -877,5 +877,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -878,5 +878,7 @@
<string name="set_source_variable">设置源变量</string> <string name="set_source_variable">设置源变量</string>
<string name="set_book_variable">设置书籍变量</string> <string name="set_book_variable">设置书籍变量</string>
<string name="summary">注释</string> <string name="summary">注释</string>
<string name="cover_config">封面设置</string>
<string name="cover_config_summary">设置默认封面样式</string>
</resources> </resources>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="useDefaultCover"
android:summary="@string/use_default_cover_s"
android:title="@string/use_default_cover"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.PreferenceCategory
android:key="dayThemeCategory"
android:title="@string/day"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.ui.widget.prefs.Preference
android:key="defaultCover"
android:title="@string/default_cover"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legado.app.ui.widget.prefs.PreferenceCategory>
<io.legado.app.ui.widget.prefs.PreferenceCategory
android:key="nightThemeCategory"
android:title="@string/night"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legado.app.ui.widget.prefs.Preference
android:key="defaultCoverDark"
android:title="@string/default_cover"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legado.app.ui.widget.prefs.PreferenceCategory>
</androidx.preference.PreferenceScreen>

@ -33,11 +33,11 @@
android:title="@string/bar_elevation" android:title="@string/bar_elevation"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.SwitchPreference <io.legado.app.ui.widget.prefs.Preference
android:defaultValue="false" android:defaultValue="false"
android:key="useDefaultCover" android:key="coverConfig"
android:title="@string/use_default_cover" android:title="@string/cover_config"
android:summary="@string/use_default_cover_s" android:summary="@string/cover_config_summary"
app:allowDividerAbove="false" app:allowDividerAbove="false"
app:allowDividerBelow="false" app:allowDividerBelow="false"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
@ -96,10 +96,6 @@
android:key="backgroundImage" android:key="backgroundImage"
android:title="@string/background_image" /> android:title="@string/background_image" />
<io.legado.app.ui.widget.prefs.Preference
android:key="defaultCover"
android:title="@string/default_cover" />
<io.legado.app.ui.widget.prefs.Preference <io.legado.app.ui.widget.prefs.Preference
android:key="saveDayTheme" android:key="saveDayTheme"
android:summary="@string/save_day_theme_summary" android:summary="@string/save_day_theme_summary"
@ -154,10 +150,6 @@
android:key="backgroundImageNight" android:key="backgroundImageNight"
android:title="@string/background_image" /> android:title="@string/background_image" />
<io.legado.app.ui.widget.prefs.Preference
android:key="defaultCoverDark"
android:title="@string/default_cover" />
<io.legado.app.ui.widget.prefs.Preference <io.legado.app.ui.widget.prefs.Preference
android:key="saveNightTheme" android:key="saveNightTheme"
android:summary="@string/save_night_theme_summary" android:summary="@string/save_night_theme_summary"

Loading…
Cancel
Save