From 6742cdeb8b3370feeb4454d6acf58b1e2219eb13 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 25 Jul 2020 10:50:54 -0400 Subject: [PATCH] Hide tracking button if none logged in, show for non-favorited manga (closes #3507) --- .../tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt index cd140d298a..bd9f9c31ad 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt @@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.MangaThumbnail import eu.kanade.tachiyomi.data.glide.toMangaThumbnail +import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.databinding.MangaInfoHeaderBinding import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager @@ -37,6 +38,7 @@ import reactivecircus.flowbinding.android.view.clicks import reactivecircus.flowbinding.android.view.longClicks import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get +import uy.kohesive.injekt.injectLazy class MangaInfoHeaderAdapter( private val controller: MangaController, @@ -44,6 +46,8 @@ class MangaInfoHeaderAdapter( ) : RecyclerView.Adapter() { + private val trackManager: TrackManager by injectLazy() + private var manga: Manga = controller.presenter.manga private var source: Source = controller.presenter.source private var trackCount: Int = 0 @@ -100,7 +104,7 @@ class MangaInfoHeaderAdapter( } with(binding.btnTracking) { - if (controller.presenter.manga.favorite) { + if (trackManager.hasLoggedServices()) { visible() if (trackCount > 0) {