From f5cc879a7ea4bbe5b49ddba2eb02a50c47860dcf Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 22 Apr 2020 20:33:17 -0400 Subject: [PATCH] Fixing some filter bugs Fixed not tracked + pressing 2 filters at once --- .../java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 2 +- .../eu/kanade/tachiyomi/ui/library/filter/FilterTagGroup.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 17c7cb65bf..b727d9b12a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -165,7 +165,7 @@ class LibraryPresenter( } } } else if (filterTracked == STATE_EXCLUDE) { - if (!hasTrack && filterTrackers.isEmpty()) return@f false + if (hasTrack && filterTrackers.isEmpty()) return@f false if (filterTrackers.isNotEmpty()) { if (service != null) { val hasServiceTrack = tracks.any { it.sync_id == service.id } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterTagGroup.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterTagGroup.kt index 3386b9c190..20c0491d74 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterTagGroup.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterTagGroup.kt @@ -98,7 +98,8 @@ class FilterTagGroup@JvmOverloads constructor(context: Context, attrs: Attribute } private fun toggleButton(index: Int, callBack: Boolean = true) { - if (itemCount == 0) return + if (itemCount == 0 || (isActivated && index != buttons.indexOfFirst { it.isActivated })) + return if (callBack) { val transition = androidx.transition.AutoTransition() transition.duration = 150