mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 19:11:49 +01:00
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 hideStartReadingButton() = rxPrefs.getBoolean("hide_reading_button", false)
|
||||
fun hideStartReadingButton() = flowPrefs.getBoolean("hide_reading_button", false)
|
||||
|
||||
fun alwaysShowChapterTransition() = flowPrefs.getBoolean(Keys.alwaysShowChapterTransition, true)
|
||||
|
||||
|
@ -832,8 +832,7 @@ class LibraryController(
|
||||
listOf(
|
||||
preferences.libraryLayout(),
|
||||
preferences.uniformGrid(),
|
||||
preferences.gridSize(),
|
||||
preferences.unreadBadgeType()
|
||||
preferences.gridSize()
|
||||
).forEach {
|
||||
it.asFlow()
|
||||
.drop(1)
|
||||
@ -842,6 +841,12 @@ class LibraryController(
|
||||
}
|
||||
.launchIn(viewScope)
|
||||
}
|
||||
preferences.hideStartReadingButton().asFlow()
|
||||
.drop(1)
|
||||
.onEach {
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
.launchIn(viewScope)
|
||||
}
|
||||
|
||||
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
|
||||
@ -1081,7 +1086,7 @@ class LibraryController(
|
||||
destroyActionModeIfNeeded()
|
||||
}
|
||||
|
||||
fun reattachAdapter() {
|
||||
private fun reattachAdapter() {
|
||||
libraryLayout = preferences.libraryLayout().get()
|
||||
setRecyclerLayout()
|
||||
val position =
|
||||
|
@ -15,7 +15,6 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.LibraryManga
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.databinding.MangaGridItemBinding
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
@ -43,7 +42,7 @@ class LibraryItem(
|
||||
get() = preferences.libraryLayout().get()
|
||||
|
||||
val hideReadingButton: Boolean
|
||||
get() = preferences.hideStartReadingButton().getOrDefault()
|
||||
get() = preferences.hideStartReadingButton().get()
|
||||
|
||||
override fun getLayoutRes(): Int {
|
||||
return if (libraryLayout == 0 || manga.isBlank()) {
|
||||
|
Loading…
Reference in New Issue
Block a user