diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt index b5b5769a5..f3245cc83 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt @@ -12,6 +12,7 @@ import com.bluelinelabs.conductor.RouterTransaction import com.bluelinelabs.conductor.support.RouterPagerAdapter import com.google.android.material.badge.BadgeDrawable import com.google.android.material.tabs.TabLayout +import com.jakewharton.rxrelay.PublishRelay import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.databinding.PagerControllerBinding @@ -41,6 +42,8 @@ class BrowseController : private val toExtensions = args.getBoolean(TO_EXTENSIONS_EXTRA, false) + val extensionListUpdateRelay: PublishRelay = PublishRelay.create() + private var adapter: BrowseAdapter? = null override fun getTitle(): String? { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt index cfb58626d..c1ac6ef60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt @@ -181,7 +181,9 @@ open class ExtensionController : drawExtensions() // Update badge on parent controller tab - (parentController as BrowseController).setExtensionUpdateBadge() + val ctrl = parentController as BrowseController + ctrl.setExtensionUpdateBadge() + ctrl.extensionListUpdateRelay.call(true) } private fun drawExtensions() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt index 1fff31782..a2632b469 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt @@ -92,6 +92,12 @@ class SourceController : adapter?.fastScroller = binding.fastScroller requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301) + + // Update list on extension changes (e.g. new installation) + (parentController as BrowseController).extensionListUpdateRelay + .subscribeUntilDestroy { + presenter.updateSources() + } } override fun onDestroyView(view: View) {