mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix theming of chapter filter button on tablets
This commit is contained in:
parent
cd59a1ffc0
commit
2cc8b64e91
3 changed files with 15 additions and 2 deletions
|
@ -330,6 +330,10 @@ class MangaDetailsController :
|
|||
private fun setItemColors() {
|
||||
getHeader()?.updateColors()
|
||||
if (adapter?.itemCount ?: 0 > 1) {
|
||||
if (isTablet) {
|
||||
val chapterHolder = binding.recycler.findViewHolderForAdapterPosition(0) as? MangaHeaderHolder
|
||||
chapterHolder?.updateColors()
|
||||
}
|
||||
(presenter.chapters).forEach { chapter ->
|
||||
val chapterHolder =
|
||||
binding.recycler.findViewHolderForItemId(chapter.id!!) as? ChapterHolder
|
||||
|
|
|
@ -284,6 +284,10 @@ class MangaHeaderHolder(
|
|||
chapterBinding.chaptersTitle.text =
|
||||
itemView.resources.getQuantityString(R.plurals.chapters_plural, count, count)
|
||||
chapterBinding.filtersText.text = presenter.currentFilters()
|
||||
if (adapter.preferences.themeMangaDetails()) {
|
||||
val accentColor = adapter.delegate.accentColor() ?: return
|
||||
chapterBinding.filterButton.imageTintList = ColorStateList.valueOf(accentColor)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -534,8 +538,13 @@ class MangaHeaderHolder(
|
|||
}
|
||||
|
||||
fun updateColors(updateAll: Boolean = true) {
|
||||
binding ?: return
|
||||
val accentColor = adapter.delegate.accentColor() ?: return
|
||||
if (binding == null) {
|
||||
if (chapterBinding != null) {
|
||||
chapterBinding.filterButton.imageTintList = ColorStateList.valueOf(accentColor)
|
||||
}
|
||||
return
|
||||
}
|
||||
val manga = adapter.presenter.manga
|
||||
with(binding) {
|
||||
trueBackdrop.setBackgroundColor(
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/webview_button"
|
||||
android:id="@+id/filter_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue