kunfei 4 лет назад
Родитель
Сommit
183d9b5a61
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt

+ 3 - 0
app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt

@@ -560,6 +560,9 @@ object ReadBookConfig {
         }
 
         fun curBgDrawable(width: Int, height: Int): Drawable {
+            if (width == 0 || height == 0) {
+                return ColorDrawable(appCtx.getCompatColor(R.color.background))
+            }
             var bgDrawable: Drawable? = null
             val resources = appCtx.resources
             try {