pull/1391/head
gedoor 3 years ago
parent 9e6ece9a39
commit cb7cec81fd
  1. 4
      app/src/main/java/io/legado/app/App.kt
  2. 5
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt

@ -17,12 +17,16 @@ import io.legado.app.help.ThemeConfig.applyDayNight
import io.legado.app.help.http.cronet.CronetLoader
import io.legado.app.utils.LanguageUtils
import io.legado.app.utils.defaultSharedPreferences
import timber.log.Timber
class App : MultiDexApplication() {
override fun onCreate() {
super.onCreate()
CrashHandler(this)
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
//预下载Cronet so
CronetLoader.preDownload()
LanguageUtils.setConfiguration(this)

@ -13,6 +13,7 @@ import io.legado.app.utils.*
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.withContext
import splitties.init.appCtx
import timber.log.Timber
import java.io.File
/**
@ -568,8 +569,10 @@ object ReadBookConfig {
BitmapUtils.decodeBitmap(curBgStr(), width, height)
)
}
} catch (e: OutOfMemoryError) {
Timber.e(e)
} catch (e: Exception) {
e.printOnDebug()
Timber.e(e)
}
return bgDrawable ?: ColorDrawable(appCtx.getCompatColor(R.color.background))
}

Loading…
Cancel
Save