From e4b5f084a94272861f97cc2b3b0b2fe4cafc0caf Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 6 May 2021 15:29:58 -0400 Subject: [PATCH] Fixed #789 Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com> --- .../ui/extension/details/ExtensionDetailsController.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/source/SourceItem.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/details/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/details/ExtensionDetailsController.kt index 85ad89b870..fd349362d2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/details/ExtensionDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/details/ExtensionDetailsController.kt @@ -185,7 +185,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) : val prefs = mutableListOf() val block: (@DSL SwitchPreferenceCompat).() -> Unit = { - key = source.getPreferenceKey() + key = source.getPreferenceKey() + "_enabled" title = when { isMultiSource && !isMultiLangSingleSource -> source.toString() else -> LocaleHelper.getSourceDisplayName(source.lang, context) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt index 3d344d41cd..e0f24f8117 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt @@ -53,12 +53,17 @@ class SourceItem(val source: CatalogueSource, header: LangItem? = null, val isPi override fun equals(other: Any?): Boolean { if (other is SourceItem) { - return source.id == other.source.id && header?.code == other.header?.code + return source.id == other.source.id && + header?.code == other.header?.code && + isPinned == other.isPinned } return false } override fun hashCode(): Int { - return source.id.hashCode() + (header?.code?.hashCode() ?: 0).toInt() + var result = source.id.hashCode() + result = 31 * result + (header?.hashCode() ?: 0) + result = 31 * result + isPinned.hashCode() + return result } }