pull/78/head
kunfei 5 years ago
parent 070a6e2524
commit 5c9438f3e1
  1. 12
      app/src/main/java/io/legado/app/help/PrefExtensions.kt
  2. 3
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  3. 1
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  4. 3
      app/src/main/java/io/legado/app/utils/ContextExtensions.kt

@ -0,0 +1,12 @@
package io.legado.app.help
import android.content.Context
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.getPrefInt
val Context.isShowRSS: Boolean
get() = getPrefBoolean("showRss", true)
val Context.threadCount: Int
get() = getPrefInt("threadCount", 6)

@ -13,6 +13,7 @@ import io.legado.app.R
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.help.BookHelp import io.legado.app.help.BookHelp
import io.legado.app.help.threadCount
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.receiver.SharedReceiverActivity import io.legado.app.receiver.SharedReceiverActivity
import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.filechooser.FileChooserDialog
@ -113,7 +114,7 @@ class OtherConfigFragment : PreferenceFragmentCompat(),
PreferKey.downloadPath -> getPrefString(PreferKey.downloadPath) PreferKey.downloadPath -> getPrefString(PreferKey.downloadPath)
?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath ?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath
?: App.INSTANCE.cacheDir.absolutePath ?: App.INSTANCE.cacheDir.absolutePath
"threadCount" -> getPrefInt("threadCount", 6) "threadCount" -> requireContext().threadCount
else -> getPrefString(key) ?: "" else -> getPrefString(key) ?: ""
} }
} }

@ -17,6 +17,7 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.help.coroutine.Coroutine import io.legado.app.help.coroutine.Coroutine
import io.legado.app.help.isShowRSS
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.service.BaseReadAloudService import io.legado.app.service.BaseReadAloudService

@ -120,6 +120,3 @@ val Context.isNightTheme: Boolean
val Context.isTransparentStatusBar: Boolean val Context.isTransparentStatusBar: Boolean
get() = getPrefBoolean("transparentStatusBar", true) get() = getPrefBoolean("transparentStatusBar", true)
val Context.isShowRSS: Boolean
get() = getPrefBoolean("showRss", true)
Loading…
Cancel
Save