mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
minor adjustments to manga details theming logic
This commit is contained in:
parent
653fee66eb
commit
1953dd3d58
1 changed files with 20 additions and 13 deletions
|
@ -218,6 +218,9 @@ class MangaDetailsController :
|
||||||
binding.swipeRefresh.isRefreshing = presenter.isLoading
|
binding.swipeRefresh.isRefreshing = presenter.isLoading
|
||||||
binding.swipeRefresh.setOnRefreshListener { presenter.refreshAll() }
|
binding.swipeRefresh.setOnRefreshListener { presenter.refreshAll() }
|
||||||
updateToolbarTitleAlpha()
|
updateToolbarTitleAlpha()
|
||||||
|
if (presenter.preferences.themeMangaDetails()) {
|
||||||
|
setItemColors()
|
||||||
|
}
|
||||||
requestFilePermissionsSafe(301, presenter.preferences, presenter.manga.isLocal())
|
requestFilePermissionsSafe(301, presenter.preferences, presenter.manga.isLocal())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,6 +324,22 @@ class MangaDetailsController :
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setItemColors() {
|
||||||
|
getHeader()?.updateColors()
|
||||||
|
if (adapter?.itemCount ?: 0 > 1) {
|
||||||
|
(presenter.chapters).forEach { chapter ->
|
||||||
|
val chapterHolder =
|
||||||
|
binding.recycler.findViewHolderForItemId(chapter.id!!) as? ChapterHolder
|
||||||
|
?: return@forEach
|
||||||
|
chapterHolder.notifyStatus(
|
||||||
|
chapter.status,
|
||||||
|
isLocked(),
|
||||||
|
chapter.progress
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Check if device is tablet, and use a second recycler to hold the details header if so */
|
/** Check if device is tablet, and use a second recycler to hold the details header if so */
|
||||||
private fun setTabletMode(view: View) {
|
private fun setTabletMode(view: View) {
|
||||||
isTablet = view.context.isTablet() && view.context.isLandscape()
|
isTablet = view.context.isTablet() && view.context.isLandscape()
|
||||||
|
@ -494,19 +513,7 @@ class MangaDetailsController :
|
||||||
manga?.vibrantCoverColor = vibrantColor
|
manga?.vibrantCoverColor = vibrantColor
|
||||||
setAccentColorValue(vibrantColor)
|
setAccentColorValue(vibrantColor)
|
||||||
setHeaderColorValue(vibrantColor)
|
setHeaderColorValue(vibrantColor)
|
||||||
getHeader()?.updateColors()
|
setItemColors()
|
||||||
if (adapter?.itemCount ?: 0 > 1) {
|
|
||||||
(presenter.chapters).forEach { chapter ->
|
|
||||||
val chapterHolder =
|
|
||||||
binding.recycler.findViewHolderForItemId(chapter.id!!) as? ChapterHolder
|
|
||||||
?: return@forEach
|
|
||||||
chapterHolder.notifyStatus(
|
|
||||||
chapter.status,
|
|
||||||
isLocked(),
|
|
||||||
chapter.progress
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setCoverColorValue()
|
setCoverColorValue()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue