pull/981/head 3.21.050816
gedoor 4 years ago
parent 45b6f77eab
commit 8d9eb42b06
  1. 1
      app/src/main/assets/updateLog.md
  2. 9
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  3. 6
      app/src/main/java/io/legado/app/base/VMBaseActivity.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt

@ -7,6 +7,7 @@
* 预下载章节可调整数目 * 预下载章节可调整数目
* 修复低版本Android使用TTS闪退。 by ag2s20150909 * 修复低版本Android使用TTS闪退。 by ag2s20150909
* 修复WebDav报错 * 修复WebDav报错
* 优化翻页动画点击翻页
**2021/05/06** **2021/05/06**
* 修复bug * 修复bug

@ -33,7 +33,8 @@ abstract class BaseActivity<VB : ViewBinding>(
val fullScreen: Boolean = true, val fullScreen: Boolean = true,
private val theme: Theme = Theme.Auto, private val theme: Theme = Theme.Auto,
private val toolBarTheme: Theme = Theme.Auto, private val toolBarTheme: Theme = Theme.Auto,
private val transparent: Boolean = false private val transparent: Boolean = false,
private val imageBg: Boolean = true
) : AppCompatActivity(), ) : AppCompatActivity(),
CoroutineScope by MainScope() { CoroutineScope by MainScope() {
@ -173,9 +174,13 @@ abstract class BaseActivity<VB : ViewBinding>(
ATH.applyBackgroundTint(window.decorView) ATH.applyBackgroundTint(window.decorView)
} }
} }
if (imageBg) {
ThemeConfig.getBgImage(this)?.let { ThemeConfig.getBgImage(this)?.let {
kotlin.runCatching { try {
window.decorView.background = it window.decorView.background = it
} catch (e: OutOfMemoryError) {
toastOnUi("Image Bg Out Of Memory")
}
} }
} }
} }

@ -7,8 +7,10 @@ import io.legado.app.constant.Theme
abstract class VMBaseActivity<VB : ViewBinding, VM : ViewModel>( abstract class VMBaseActivity<VB : ViewBinding, VM : ViewModel>(
fullScreen: Boolean = true, fullScreen: Boolean = true,
theme: Theme = Theme.Auto, theme: Theme = Theme.Auto,
toolBarTheme: Theme = Theme.Auto toolBarTheme: Theme = Theme.Auto,
) : BaseActivity<VB>(fullScreen, theme, toolBarTheme) { transparent: Boolean = false,
imageBg: Boolean = true
) : BaseActivity<VB>(fullScreen, theme, toolBarTheme, transparent, imageBg) {
protected abstract val viewModel: VM protected abstract val viewModel: VM

@ -39,7 +39,7 @@ import io.legado.app.utils.requestInputMethod
* 阅读界面 * 阅读界面
*/ */
abstract class ReadBookBaseActivity : abstract class ReadBookBaseActivity :
VMBaseActivity<ActivityBookReadBinding, ReadBookViewModel>() { VMBaseActivity<ActivityBookReadBinding, ReadBookViewModel>(imageBg = false) {
override val viewModel: ReadBookViewModel override val viewModel: ReadBookViewModel
by viewModels() by viewModels()

Loading…
Cancel
Save