mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
refactor: Move stuff around
This commit is contained in:
parent
3b42210f10
commit
913f9b6b5c
1 changed files with 15 additions and 13 deletions
|
@ -363,18 +363,20 @@ class PagerPageHolder(
|
||||||
val isAnimated = ImageUtil.isAnimatedAndSupported(actualSource)
|
val isAnimated = ImageUtil.isAnimatedAndSupported(actualSource)
|
||||||
val bgColor = ReaderBackgroundColor.fromPreference(viewer.config.readerTheme)
|
val bgColor = ReaderBackgroundColor.fromPreference(viewer.config.readerTheme)
|
||||||
val bgType = getBGType(viewer.config.readerTheme, context)
|
val bgType = getBGType(viewer.config.readerTheme, context)
|
||||||
val background = if (!isAnimated && bgColor.isSmartColor) {
|
val background = if (bgColor.isSmartColor) {
|
||||||
if (page.bg != null && page.bgType == bgType) page.bg
|
if (!isAnimated) {
|
||||||
else {
|
if (page.bg != null && page.bgType == bgType) page.bg
|
||||||
try {
|
else {
|
||||||
setBG(actualSource.peek().inputStream())
|
try {
|
||||||
} catch (e: Exception) {
|
setBG(actualSource.peek().inputStream())
|
||||||
Logger.e(e) { e.localizedMessage?.toString() ?: "" }
|
} catch (e: Exception) {
|
||||||
ColorDrawable(Color.WHITE)
|
Logger.e(e) { e.localizedMessage?.toString() ?: "" }
|
||||||
|
ColorDrawable(Color.WHITE)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
page.bg
|
||||||
}
|
}
|
||||||
} else if (bgColor.isSmartColor && page.bg != null) {
|
|
||||||
page.bg
|
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
@ -387,9 +389,9 @@ class PagerPageHolder(
|
||||||
withUIContext {
|
withUIContext {
|
||||||
val (bg, bgType) = _bg
|
val (bg, bgType) = _bg
|
||||||
if (bg != null) pageView?.background = bg
|
if (bg != null) pageView?.background = bg
|
||||||
if (!isAnimated && page.bg == null && page.bgType != bgType) {
|
if (!isAnimated) {
|
||||||
page.bg = pageView?.background
|
if (page.bg == null) page.bg = pageView?.background
|
||||||
page.bgType = bgType
|
if (page.bgType != bgType) page.bgType = bgType
|
||||||
}
|
}
|
||||||
setImage(source, isAnimated, imageConfig)
|
setImage(source, isAnimated, imageConfig)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue