diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt index 6144cebf40..0918673a7b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.ui.extension -import android.app.Application import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault @@ -73,7 +72,7 @@ class ExtensionBottomPresenter( @Synchronized private fun toItems(tuple: ExtensionTuple): List { - val context = Injekt.get() + val context = bottomSheet.context val activeLangs = preferences.enabledLanguages().getOrDefault() val (installed, untrusted, available) = tuple diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt index 965c09cb99..d965fc031b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationMangaDialog.kt @@ -23,9 +23,9 @@ class MigrationMangaDialog(bundle: Bundle? = null) : DialogController(bundle) override fun onCreateDialog(savedViewState: Bundle?): Dialog { val confirmRes = if (copy) R.plurals.copy_manga else R.plurals.migrate_manga - val confirmString = applicationContext?.resources?.getQuantityString(confirmRes, mangaSet, + val confirmString = activity?.resources?.getQuantityString(confirmRes, mangaSet, mangaSet, ( - if (mangaSkipped > 0) " " + applicationContext?.getString(R.string.skipping_, mangaSkipped) + if (mangaSkipped > 0) " " + view?.context?.getString(R.string.skipping_, mangaSkipped) else "")) ?: "" return MaterialDialog(activity!!).show { message(text = confirmString) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt index 05df7853ef..5fe5b1eaa3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt @@ -107,7 +107,7 @@ class MigrationProcessHolder( } else { migration_manga_card_to.progress.gone() migration_manga_card_to.title.text = - view.context.applicationContext.getString(R.string.no_alternatives_found) + view.context.getString(R.string.no_alternatives_found) } migration_menu.visible() skip_manga.gone() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index 99e9b8fb0a..8d7e1dadef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -90,8 +90,8 @@ class SourceController : NucleusController(), override fun getTitle(): String? { return if (showingExtensions) - applicationContext?.getString(R.string.extensions) - else applicationContext?.getString(R.string.sources) + view?.context?.getString(R.string.extensions) + else view?.context?.getString(R.string.sources) } override fun createPresenter(): SourcePresenter { @@ -304,7 +304,7 @@ class SourceController : NucleusController(), val searchView = searchItem.actionView as SearchView // Change hint to show global search. - searchView.queryHint = applicationContext?.getString(R.string.search_extensions) + searchView.queryHint = view?.context?.getString(R.string.search_extensions) // Create query listener which opens the global search view. setOnQueryTextChangeListener(searchView) { @@ -321,7 +321,7 @@ class SourceController : NucleusController(), val searchView = searchItem.actionView as SearchView // Change hint to show global search. - searchView.queryHint = applicationContext?.getString(R.string.global_search) + searchView.queryHint = view?.context?.getString(R.string.global_search) // Create query listener which opens the global search view. setOnQueryTextChangeListener(searchView, true) {