This commit is contained in:
Jay 2020-05-23 03:45:48 -04:00
parent acfc81b9b9
commit 71b86d7ba1
4 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.ui.extension package eu.kanade.tachiyomi.ui.extension
import android.app.Application
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.preference.getOrDefault
@ -73,7 +72,7 @@ class ExtensionBottomPresenter(
@Synchronized @Synchronized
private fun toItems(tuple: ExtensionTuple): List<ExtensionItem> { private fun toItems(tuple: ExtensionTuple): List<ExtensionItem> {
val context = Injekt.get<Application>() val context = bottomSheet.context
val activeLangs = preferences.enabledLanguages().getOrDefault() val activeLangs = preferences.enabledLanguages().getOrDefault()
val (installed, untrusted, available) = tuple val (installed, untrusted, available) = tuple

View File

@ -23,9 +23,9 @@ class MigrationMangaDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
override fun onCreateDialog(savedViewState: Bundle?): Dialog { override fun onCreateDialog(savedViewState: Bundle?): Dialog {
val confirmRes = if (copy) R.plurals.copy_manga else R.plurals.migrate_manga 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, ( mangaSet, (
if (mangaSkipped > 0) " " + applicationContext?.getString(R.string.skipping_, mangaSkipped) if (mangaSkipped > 0) " " + view?.context?.getString(R.string.skipping_, mangaSkipped)
else "")) ?: "" else "")) ?: ""
return MaterialDialog(activity!!).show { return MaterialDialog(activity!!).show {
message(text = confirmString) message(text = confirmString)

View File

@ -107,7 +107,7 @@ class MigrationProcessHolder(
} else { } else {
migration_manga_card_to.progress.gone() migration_manga_card_to.progress.gone()
migration_manga_card_to.title.text = 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() migration_menu.visible()
skip_manga.gone() skip_manga.gone()

View File

@ -90,8 +90,8 @@ class SourceController : NucleusController<SourcePresenter>(),
override fun getTitle(): String? { override fun getTitle(): String? {
return if (showingExtensions) return if (showingExtensions)
applicationContext?.getString(R.string.extensions) view?.context?.getString(R.string.extensions)
else applicationContext?.getString(R.string.sources) else view?.context?.getString(R.string.sources)
} }
override fun createPresenter(): SourcePresenter { override fun createPresenter(): SourcePresenter {
@ -304,7 +304,7 @@ class SourceController : NucleusController<SourcePresenter>(),
val searchView = searchItem.actionView as SearchView val searchView = searchItem.actionView as SearchView
// Change hint to show global search. // 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. // Create query listener which opens the global search view.
setOnQueryTextChangeListener(searchView) { setOnQueryTextChangeListener(searchView) {
@ -321,7 +321,7 @@ class SourceController : NucleusController<SourcePresenter>(),
val searchView = searchItem.actionView as SearchView val searchView = searchItem.actionView as SearchView
// Change hint to show global search. // 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. // Create query listener which opens the global search view.
setOnQueryTextChangeListener(searchView, true) { setOnQueryTextChangeListener(searchView, true) {