From 539e2ed2b04be2ba618f80ab3e8bd7ce8fca64c8 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 21 Aug 2019 13:54:12 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 252d635a5..45097ff16 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -46,7 +46,15 @@ object ReadBookConfig { when (bgType) { 0 -> bg = ColorDrawable(Color.parseColor(bgStr)) 1 -> bg = Drawable.createFromStream(App.INSTANCE.assets.open("bg" + File.separator + bgStr), "bg") - 2 -> bg = Drawable.createFromPath(bgStr) + else -> { + try { + bg = Drawable.createFromPath(bgStr) + } finally { + bg ?: let { + bg = ColorDrawable(Color.parseColor("#015A86")) + } + } + } } } }