From 26d5a87bef203292cba265609b9ce10aa3e7db85 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 26 Jul 2020 17:09:56 -0400 Subject: [PATCH] Fix source item flashing when pinning --- .../kanade/tachiyomi/ui/browse/source/SourceItem.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt index b721aecbe..c8bf4f9ea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceItem.kt @@ -46,4 +46,15 @@ data class SourceItem( ) { holder.bind(this) } + + override fun equals(other: Any?): Boolean { + if (other is SourceItem) { + return source.id == other.source.id && getHeader()?.code == other.getHeader()?.code + } + return false + } + + override fun hashCode(): Int { + return source.id.hashCode() + (getHeader()?.code?.hashCode() ?: 0).toInt() + } }