fix: Paged reading mode failing if "Smart Background" is enabled

This commit is contained in:
Ahmad Ansori Palembani 2024-05-30 17:51:31 +07:00
parent f4a0264cf0
commit 179680b0d4
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -504,18 +504,19 @@ class PagerPageHolder(
} }
// if the user switches to automatic when pages are already cached, the bg needs to be loaded // if the user switches to automatic when pages are already cached, the bg needs to be loaded
else { else {
setImage(actualSource, false, imageConfig) val background =
try { try {
pageView?.background = setBG(actualSource.inputStream()) setBG(actualSource.peek().inputStream())
} catch (e: Exception) { } catch (e: Exception) {
Timber.e(e.localizedMessage) Timber.e(e.localizedMessage)
pageView?.background = ColorDrawable(Color.WHITE) ColorDrawable(Color.WHITE)
} finally { }
setImage(actualSource, false, imageConfig)
pageView?.background = background
page.bg = pageView?.background page.bg = pageView?.background
page.bgType = bgType page.bgType = bgType
} }
}
} else { } else {
setImage(actualSource, false, imageConfig) setImage(actualSource, false, imageConfig)
} }