mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
improve background filtering
This commit is contained in:
parent
17164d3fef
commit
50619b7312
2 changed files with 16 additions and 0 deletions
|
|
@ -9,4 +9,18 @@ data class CustomizationFilter(
|
|||
get() {
|
||||
return onlyPurchased || months.isNotEmpty()
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other is CustomizationFilter) {
|
||||
return onlyPurchased == other.onlyPurchased && ascending == other.ascending && months.size == other.months.size && months.containsAll(other.months)
|
||||
}
|
||||
return super.equals(other)
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = onlyPurchased.hashCode()
|
||||
result = 31 * result + ascending.hashCode()
|
||||
result = 31 * result + months.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -334,6 +334,8 @@ class AvatarCustomizationFragment :
|
|||
button.text
|
||||
button.setOnCheckedChangeListener { _, isChecked ->
|
||||
val newFilter = filter.copy()
|
||||
newFilter.months = mutableListOf()
|
||||
newFilter.months.addAll(filter.months)
|
||||
if (!isChecked && newFilter.months.contains(identifier)) {
|
||||
button.typeface = Typeface.create("sans-serif", Typeface.NORMAL)
|
||||
newFilter.months.remove(identifier)
|
||||
|
|
|
|||
Loading…
Reference in a new issue