Fixing some filter bugs

Fixed not tracked + pressing 2 filters at once
This commit is contained in:
Jay 2020-04-22 20:33:17 -04:00
parent af3fadd62a
commit f5cc879a7e
2 changed files with 3 additions and 2 deletions

View File

@ -165,7 +165,7 @@ class LibraryPresenter(
} }
} }
} else if (filterTracked == STATE_EXCLUDE) { } else if (filterTracked == STATE_EXCLUDE) {
if (!hasTrack && filterTrackers.isEmpty()) return@f false if (hasTrack && filterTrackers.isEmpty()) return@f false
if (filterTrackers.isNotEmpty()) { if (filterTrackers.isNotEmpty()) {
if (service != null) { if (service != null) {
val hasServiceTrack = tracks.any { it.sync_id == service.id } val hasServiceTrack = tracks.any { it.sync_id == service.id }

View File

@ -98,7 +98,8 @@ class FilterTagGroup@JvmOverloads constructor(context: Context, attrs: Attribute
} }
private fun toggleButton(index: Int, callBack: Boolean = true) { private fun toggleButton(index: Int, callBack: Boolean = true) {
if (itemCount == 0) return if (itemCount == 0 || (isActivated && index != buttons.indexOfFirst { it.isActivated }))
return
if (callBack) { if (callBack) {
val transition = androidx.transition.AutoTransition() val transition = androidx.transition.AutoTransition()
transition.duration = 150 transition.duration = 150