Fix hideStartReadingButton setting not updating in real time
This commit is contained in:
parent
449b33d731
commit
799ac037e6
@ -357,7 +357,7 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun unreadBadgeType() = flowPrefs.getInt("unread_badge_type", 2)
|
fun unreadBadgeType() = flowPrefs.getInt("unread_badge_type", 2)
|
||||||
|
|
||||||
fun hideStartReadingButton() = rxPrefs.getBoolean("hide_reading_button", false)
|
fun hideStartReadingButton() = flowPrefs.getBoolean("hide_reading_button", false)
|
||||||
|
|
||||||
fun alwaysShowChapterTransition() = flowPrefs.getBoolean(Keys.alwaysShowChapterTransition, true)
|
fun alwaysShowChapterTransition() = flowPrefs.getBoolean(Keys.alwaysShowChapterTransition, true)
|
||||||
|
|
||||||
|
@ -832,8 +832,7 @@ class LibraryController(
|
|||||||
listOf(
|
listOf(
|
||||||
preferences.libraryLayout(),
|
preferences.libraryLayout(),
|
||||||
preferences.uniformGrid(),
|
preferences.uniformGrid(),
|
||||||
preferences.gridSize(),
|
preferences.gridSize()
|
||||||
preferences.unreadBadgeType()
|
|
||||||
).forEach {
|
).forEach {
|
||||||
it.asFlow()
|
it.asFlow()
|
||||||
.drop(1)
|
.drop(1)
|
||||||
@ -842,6 +841,12 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
.launchIn(viewScope)
|
.launchIn(viewScope)
|
||||||
}
|
}
|
||||||
|
preferences.hideStartReadingButton().asFlow()
|
||||||
|
.drop(1)
|
||||||
|
.onEach {
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
.launchIn(viewScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||||
@ -1081,7 +1086,7 @@ class LibraryController(
|
|||||||
destroyActionModeIfNeeded()
|
destroyActionModeIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun reattachAdapter() {
|
private fun reattachAdapter() {
|
||||||
libraryLayout = preferences.libraryLayout().get()
|
libraryLayout = preferences.libraryLayout().get()
|
||||||
setRecyclerLayout()
|
setRecyclerLayout()
|
||||||
val position =
|
val position =
|
||||||
|
@ -15,7 +15,6 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
|||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.database.models.LibraryManga
|
import eu.kanade.tachiyomi.data.database.models.LibraryManga
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
|
||||||
import eu.kanade.tachiyomi.databinding.MangaGridItemBinding
|
import eu.kanade.tachiyomi.databinding.MangaGridItemBinding
|
||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||||
@ -43,7 +42,7 @@ class LibraryItem(
|
|||||||
get() = preferences.libraryLayout().get()
|
get() = preferences.libraryLayout().get()
|
||||||
|
|
||||||
val hideReadingButton: Boolean
|
val hideReadingButton: Boolean
|
||||||
get() = preferences.hideStartReadingButton().getOrDefault()
|
get() = preferences.hideStartReadingButton().get()
|
||||||
|
|
||||||
override fun getLayoutRes(): Int {
|
override fun getLayoutRes(): Int {
|
||||||
return if (libraryLayout == 0 || manga.isBlank()) {
|
return if (libraryLayout == 0 || manga.isBlank()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user