diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/NoResultsException.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/NoResultsException.kt deleted file mode 100644 index ae6f39bcd..000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/NoResultsException.kt +++ /dev/null @@ -1,3 +0,0 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse - -class NoResultsException : Exception() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt index 5fe8327aa..45af95fc8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt @@ -6,15 +6,15 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.util.view.visibleIf -import kotlinx.android.synthetic.main.catalogue_grid_item.download_text -import kotlinx.android.synthetic.main.catalogue_grid_item.local_text -import kotlinx.android.synthetic.main.catalogue_grid_item.thumbnail -import kotlinx.android.synthetic.main.catalogue_grid_item.title -import kotlinx.android.synthetic.main.catalogue_grid_item.unread_text +import kotlinx.android.synthetic.main.source_grid_item.download_text +import kotlinx.android.synthetic.main.source_grid_item.local_text +import kotlinx.android.synthetic.main.source_grid_item.thumbnail +import kotlinx.android.synthetic.main.source_grid_item.title +import kotlinx.android.synthetic.main.source_grid_item.unread_text /** * Class used to hold the displayed data of a manga in the library, like the cover or the title. - * All the elements from the layout file "item_catalogue_grid" are available in this class. + * All the elements from the layout file "item_source_grid" are available in this class. * * @param view the inflated view for this holder. * @param adapter the adapter handling this holder. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt index 1651b7f97..596f476ae 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryItem.kt @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.data.database.models.LibraryManga import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.catalogue_grid_item.view.card -import kotlinx.android.synthetic.main.catalogue_grid_item.view.gradient +import kotlinx.android.synthetic.main.source_grid_item.view.card +import kotlinx.android.synthetic.main.source_grid_item.view.gradient import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -29,9 +29,9 @@ class LibraryItem(val manga: LibraryManga, private val libraryAsList: Preference override fun getLayoutRes(): Int { return if (libraryAsList.getOrDefault()) - R.layout.catalogue_list_item + R.layout.source_list_item else - R.layout.catalogue_grid_item + R.layout.source_grid_item } override fun createViewHolder(view: View, adapter: FlexibleAdapter>): LibraryHolder { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt index f8f871745..8d49e2eba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt @@ -6,11 +6,11 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.util.view.visibleIf -import kotlinx.android.synthetic.main.catalogue_list_item.download_text -import kotlinx.android.synthetic.main.catalogue_list_item.local_text -import kotlinx.android.synthetic.main.catalogue_list_item.thumbnail -import kotlinx.android.synthetic.main.catalogue_list_item.title -import kotlinx.android.synthetic.main.catalogue_list_item.unread_text +import kotlinx.android.synthetic.main.source_list_item.download_text +import kotlinx.android.synthetic.main.source_list_item.local_text +import kotlinx.android.synthetic.main.source_list_item.thumbnail +import kotlinx.android.synthetic.main.source_list_item.title +import kotlinx.android.synthetic.main.source_list_item.unread_text /** * Class used to hold the displayed data of a manga in the library, like the cover or the title. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index fab5a3c37..ba3b489d3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -21,8 +21,6 @@ import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController import eu.kanade.tachiyomi.ui.base.controller.RootController import eu.kanade.tachiyomi.ui.base.controller.TabbedController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.CatalogueController -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController import eu.kanade.tachiyomi.ui.download.DownloadController import eu.kanade.tachiyomi.ui.extension.ExtensionController import eu.kanade.tachiyomi.ui.library.LibraryController @@ -30,6 +28,8 @@ import eu.kanade.tachiyomi.ui.manga.MangaController import eu.kanade.tachiyomi.ui.more.MoreController import eu.kanade.tachiyomi.ui.recent.history.HistoryController import eu.kanade.tachiyomi.ui.recent.updates.UpdatesController +import eu.kanade.tachiyomi.ui.source.SourceController +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchController import java.util.Date import java.util.concurrent.TimeUnit import kotlinx.coroutines.Dispatchers @@ -83,7 +83,7 @@ class MainActivity : BaseActivity() { R.id.nav_library -> setRoot(LibraryController(), id) R.id.nav_updates -> setRoot(UpdatesController(), id) R.id.nav_history -> setRoot(HistoryController(), id) - R.id.nav_sources -> setRoot(CatalogueController(), id) + R.id.nav_sources -> setRoot(SourceController(), id) R.id.nav_more -> setRoot(MoreController(), id) } } else if (!isHandlingShortcut) { @@ -228,7 +228,7 @@ class MainActivity : BaseActivity() { if (router.backstackSize > 1) { router.popToRoot() } - router.pushController(CatalogueSearchController(query).withFadeTransaction()) + router.pushController(GlobalSearchController(query).withFadeTransaction()) } } INTENT_SEARCH -> { @@ -238,7 +238,7 @@ class MainActivity : BaseActivity() { if (router.backstackSize > 1) { router.popToRoot() } - router.pushController(CatalogueSearchController(query, filter).withFadeTransaction()) + router.pushController(GlobalSearchController(query, filter).withFadeTransaction()) } } else -> { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 9ba600ab6..af311ff05 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -44,12 +44,12 @@ import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaController +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchController import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.util.lang.truncateCenter import eu.kanade.tachiyomi.util.system.toast @@ -549,7 +549,7 @@ class MangaInfoController : NucleusController(), */ private fun performGlobalSearch(query: String) { val router = parentController?.router ?: return - router.pushController(CatalogueSearchController(query).withFadeTransaction()) + router.pushController(GlobalSearchController(query).withFadeTransaction()) } /** @@ -570,7 +570,7 @@ class MangaInfoController : NucleusController(), router.handleBack() previousController.search(query) } - is BrowseCatalogueController -> { + is BrowseSourceController -> { router.handleBack() previousController.searchWithQuery(query) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt index 850de20fd..b0908b673 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt @@ -5,8 +5,8 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import kotlinx.android.synthetic.main.catalogue_list_item.thumbnail -import kotlinx.android.synthetic.main.catalogue_list_item.title +import kotlinx.android.synthetic.main.source_list_item.thumbnail +import kotlinx.android.synthetic.main.source_list_item.title class MangaHolder( private val view: View, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt index 94a67fdba..9f9146017 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaItem.kt @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga class MangaItem(val manga: Manga) : AbstractFlexibleItem() { override fun getLayoutRes(): Int { - return R.layout.catalogue_list_item + return R.layout.source_list_item } override fun createViewHolder(view: View, adapter: FlexibleAdapter>): MangaHolder { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt index eb7f48bac..f80be9510 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt @@ -9,17 +9,17 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchPresenter +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchController +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchPresenter import uy.kohesive.injekt.injectLazy class SearchController( private var manga: Manga? = null -) : CatalogueSearchController(manga?.title) { +) : GlobalSearchController(manga?.title) { private var newManga: Manga? = null - override fun createPresenter(): CatalogueSearchPresenter { + override fun createPresenter(): GlobalSearchPresenter { return SearchPresenter(initialQuery, manga!!) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt index 8147828ad..3c9e7e579 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchPresenter.kt @@ -9,9 +9,9 @@ import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchCardItem -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchItem -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchPresenter +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchCardItem +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchItem +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchPresenter import eu.kanade.tachiyomi.util.chapter.syncChaptersWithSource import rx.Observable import rx.android.schedulers.AndroidSchedulers @@ -20,7 +20,7 @@ import rx.schedulers.Schedulers class SearchPresenter( initialQuery: String? = "", private val manga: Manga -) : CatalogueSearchPresenter(initialQuery) { +) : GlobalSearchPresenter(initialQuery) { private val replacingMangaRelay = BehaviorRelay.create() @@ -36,9 +36,9 @@ class SearchPresenter( .sortedByDescending { it.id == manga.source } } - override fun createCatalogueSearchItem(source: CatalogueSource, results: List?): CatalogueSearchItem { + override fun createCatalogueSearchItem(source: CatalogueSource, results: List?): GlobalSearchItem { // Set the catalogue search item as highlighted if the source matches that of the selected manga - return CatalogueSearchItem(source, results, source.id == manga.source) + return GlobalSearchItem(source, results, source.id == manga.source) } override fun networkToLocalManga(sManga: SManga, sourceId: Long): Manga { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt index a0658e3db..3506aa760 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SelectionHeader.kt @@ -7,7 +7,7 @@ import eu.davidea.flexibleadapter.items.AbstractHeaderItem import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import kotlinx.android.synthetic.main.catalogue_main_controller_card.title +import kotlinx.android.synthetic.main.source_main_controller_card.title /** * Item that contains the selection header. @@ -18,7 +18,7 @@ class SelectionHeader : AbstractHeaderItem() { * Returns the layout resource of this item. */ override fun getLayoutRes(): Int { - return R.layout.catalogue_main_controller_card + return R.layout.source_main_controller_card } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt index 4f08ca8ae..b6de462ee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt @@ -8,11 +8,11 @@ import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.roundTextIcon import io.github.mthli.slice.Slice -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.card -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.image -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.source_browse -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.source_latest -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.title +import kotlinx.android.synthetic.main.source_main_controller_card_item.card +import kotlinx.android.synthetic.main.source_main_controller_card_item.image +import kotlinx.android.synthetic.main.source_main_controller_card_item.source_browse +import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest +import kotlinx.android.synthetic.main.source_main_controller_card_item.title class SourceHolder(view: View, override val adapter: SourceAdapter) : BaseFlexibleViewHolder(view, adapter), diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt index 99528cf5b..a1088d11f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceItem.kt @@ -21,7 +21,7 @@ data class SourceItem(val source: Source, val header: SelectionHeader? = null) : * Returns the layout resource of this item. */ override fun getLayoutRes(): Int { - return R.layout.catalogue_main_controller_card_item + return R.layout.source_main_controller_card_item } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt similarity index 78% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt index eae9e075a..df2d07f23 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangHolder.kt @@ -1,10 +1,10 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.system.LocaleHelper -import kotlinx.android.synthetic.main.catalogue_main_controller_card.title +import kotlinx.android.synthetic.main.source_main_controller_card.title class LangHolder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt similarity index 91% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt index 5206496e9..a1513fa48 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/LangItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/LangItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -18,7 +18,7 @@ data class LangItem(val code: String) : AbstractHeaderItem() { * Returns the layout resource of this item. */ override fun getLayoutRes(): Int { - return R.layout.catalogue_main_controller_card + return R.layout.source_main_controller_card } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt similarity index 78% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt index 2c9ac946c..cb23a9deb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible @@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.util.system.getResourceColor /** * Adapter that holds the catalogue cards. * - * @param controller instance of [CatalogueController]. + * @param controller instance of [SourceController]. */ -class CatalogueAdapter(val controller: CatalogueController) : +class SourceAdapter(val controller: SourceController) : FlexibleAdapter>(null, controller, true) { val cardBackground = controller.activity!!.getResourceColor(R.attr.colorSurface) @@ -31,7 +31,7 @@ class CatalogueAdapter(val controller: CatalogueController) : /** * Listener which should be called when user clicks browse. - * Note: Should only be handled by [CatalogueController] + * Note: Should only be handled by [SourceController] */ interface OnBrowseClickListener { fun onBrowseClick(position: Int) @@ -39,7 +39,7 @@ class CatalogueAdapter(val controller: CatalogueController) : /** * Listener which should be called when user clicks latest. - * Note: Should only be handled by [CatalogueController] + * Note: Should only be handled by [SourceController] */ interface OnLatestClickListener { fun onLatestClick(position: Int) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt similarity index 82% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index fceab5a3e..ec6688d09 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.Manifest.permission.WRITE_EXTERNAL_STORAGE import android.view.LayoutInflater @@ -20,41 +20,41 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.databinding.CatalogueMainControllerBinding +import eu.kanade.tachiyomi.databinding.SourceMainControllerBinding import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.RootController import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController -import eu.kanade.tachiyomi.ui.catalogue.latest.LatestUpdatesController import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController +import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchController +import eu.kanade.tachiyomi.ui.source.latest.LatestUpdatesController import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get /** * This controller shows and manages the different catalogues enabled by the user. - * This controller should only handle UI actions, IO actions should be done by [CataloguePresenter] - * [CatalogueAdapter.OnBrowseClickListener] call function data on browse item click. - * [CatalogueAdapter.OnLatestClickListener] call function data on latest item click + * This controller should only handle UI actions, IO actions should be done by [SourcePresenter] + * [SourceAdapter.OnBrowseClickListener] call function data on browse item click. + * [SourceAdapter.OnLatestClickListener] call function data on latest item click */ -class CatalogueController : NucleusController(), +class SourceController : NucleusController(), RootController, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, - CatalogueAdapter.OnBrowseClickListener, - CatalogueAdapter.OnLatestClickListener { + SourceAdapter.OnBrowseClickListener, + SourceAdapter.OnLatestClickListener { private val preferences: PreferencesHelper = Injekt.get() /** * Adapter containing sources. */ - private var adapter: CatalogueAdapter? = null + private var adapter: SourceAdapter? = null - private lateinit var binding: CatalogueMainControllerBinding + private lateinit var binding: SourceMainControllerBinding init { setHasOptionsMenu(true) @@ -64,26 +64,26 @@ class CatalogueController : NucleusController(), return applicationContext?.getString(R.string.label_sources) } - override fun createPresenter(): CataloguePresenter { - return CataloguePresenter() + override fun createPresenter(): SourcePresenter { + return SourcePresenter() } /** - * Initiate the view with [R.layout.catalogue_main_controller]. + * Initiate the view with [R.layout.source_main_controller]. * * @param inflater used to load the layout xml. * @param container containing parent views. * @return inflated view. */ override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { - binding = CatalogueMainControllerBinding.inflate(inflater) + binding = SourceMainControllerBinding.inflate(inflater) return binding.root } override fun onViewCreated(view: View) { super.onViewCreated(view) - adapter = CatalogueAdapter(this) + adapter = SourceAdapter(this) // Create recycler and set adapter. binding.recycler.layoutManager = LinearLayoutManager(view.context) @@ -109,7 +109,7 @@ class CatalogueController : NucleusController(), override fun onItemClick(view: View, position: Int): Boolean { val item = adapter?.getItem(position) as? SourceItem ?: return false val source = item.source - openCatalogue(source, BrowseCatalogueController(source)) + openCatalogue(source, BrowseSourceController(source)) return false } @@ -117,7 +117,7 @@ class CatalogueController : NucleusController(), val activity = activity ?: return val item = adapter?.getItem(position) as? SourceItem ?: return - val isPinned = item.header?.code?.equals(CataloguePresenter.PINNED_KEY) ?: false + val isPinned = item.header?.code?.equals(SourcePresenter.PINNED_KEY) ?: false MaterialDialog.Builder(activity) .title(item.source.name) @@ -152,14 +152,14 @@ class CatalogueController : NucleusController(), } /** - * Called when browse is clicked in [CatalogueAdapter] + * Called when browse is clicked in [SourceAdapter] */ override fun onBrowseClick(position: Int) { onItemClick(view!!, position) } /** - * Called when latest is clicked in [CatalogueAdapter] + * Called when latest is clicked in [SourceAdapter] */ override fun onLatestClick(position: Int) { val item = adapter?.getItem(position) as? SourceItem ?: return @@ -169,7 +169,7 @@ class CatalogueController : NucleusController(), /** * Opens a catalogue with the given controller. */ - private fun openCatalogue(source: CatalogueSource, controller: BrowseCatalogueController) { + private fun openCatalogue(source: CatalogueSource, controller: BrowseSourceController) { preferences.lastUsedCatalogueSource().set(source.id) router.pushController(controller.withFadeTransaction()) } @@ -182,7 +182,7 @@ class CatalogueController : NucleusController(), */ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { // Inflate menu - inflater.inflate(R.menu.catalogue_main, menu) + inflater.inflate(R.menu.source_main, menu) // Initialize search option. val searchItem = menu.findItem(R.id.action_search) @@ -198,7 +198,7 @@ class CatalogueController : NucleusController(), } fun performGlobalSearch(query: String) { - router.pushController(CatalogueSearchController(query).withFadeTransaction()) + router.pushController(GlobalSearchController(query).withFadeTransaction()) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt index baf596eeb..625696d75 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceDividerItemDecoration.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceDividerItemDecoration.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.content.Context import android.graphics.Canvas diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt similarity index 73% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt index 8f2af3c0b..ec58cf8f3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.view.View import eu.kanade.tachiyomi.R @@ -9,13 +9,13 @@ import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.roundTextIcon import eu.kanade.tachiyomi.util.view.visible import io.github.mthli.slice.Slice -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.card -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.image -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.source_browse -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.source_latest -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.title +import kotlinx.android.synthetic.main.source_main_controller_card_item.card +import kotlinx.android.synthetic.main.source_main_controller_card_item.image +import kotlinx.android.synthetic.main.source_main_controller_card_item.source_browse +import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest +import kotlinx.android.synthetic.main.source_main_controller_card_item.title -class SourceHolder(view: View, override val adapter: CatalogueAdapter) : +class SourceHolder(view: View, override val adapter: SourceAdapter) : BaseFlexibleViewHolder(view, adapter), SlicedHolder { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt similarity index 88% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt index 4b9ad1ebf..e98180bed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/SourceItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -21,14 +21,14 @@ data class SourceItem(val source: CatalogueSource, val header: LangItem? = null) * Returns the layout resource of this item. */ override fun getLayoutRes(): Int { - return R.layout.catalogue_main_controller_card_item + return R.layout.source_main_controller_card_item } /** * Creates a new view holder for this item. */ override fun createViewHolder(view: View, adapter: FlexibleAdapter>): SourceHolder { - return SourceHolder(view, adapter as CatalogueAdapter) + return SourceHolder(view, adapter as SourceAdapter) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt similarity index 92% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt index 769a93166..176493a29 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourcePresenter.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.os.Bundle import eu.kanade.tachiyomi.data.preference.PreferencesHelper @@ -16,16 +16,16 @@ import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get /** - * Presenter of [CatalogueController] + * Presenter of [SourceController] * Function calls should be done from here. UI calls should be done from the controller. * * @param sourceManager manages the different sources. * @param preferences application preferences. */ -class CataloguePresenter( +class SourcePresenter( val sourceManager: SourceManager = Injekt.get(), private val preferences: PreferencesHelper = Injekt.get() -) : BasePresenter() { +) : BasePresenter() { var sources = getEnabledSources() @@ -76,7 +76,7 @@ class CataloguePresenter( } sourceSubscription = Observable.just(sourceItems) - .subscribeLatestCache(CatalogueController::setSources) + .subscribeLatestCache(SourceController::setSources) } private fun loadLastUsedSource() { @@ -88,7 +88,7 @@ class CataloguePresenter( sharedObs.skip(1).delay(500, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread())) .distinctUntilChanged() .map { (sourceManager.get(it) as? CatalogueSource)?.let { SourceItem(it) } } - .subscribeLatestCache(CatalogueController::setLastUsedSource) + .subscribeLatestCache(SourceController::setLastUsedSource) } fun updateSources() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt similarity index 93% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index fa71543d0..fbfb97c19 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.content.res.Configuration import android.os.Bundle @@ -23,7 +23,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Category import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.databinding.CatalogueControllerBinding +import eu.kanade.tachiyomi.databinding.SourceControllerBinding import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.online.HttpSource @@ -51,8 +51,8 @@ import uy.kohesive.injekt.injectLazy /** * Controller to manage the catalogues available in the app. */ -open class BrowseCatalogueController(bundle: Bundle) : - NucleusController(bundle), +open class BrowseSourceController(bundle: Bundle) : + NucleusController(bundle), FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, FlexibleAdapter.EndlessScrollListener, @@ -77,7 +77,7 @@ open class BrowseCatalogueController(bundle: Bundle) : /** * Sheet containing filter items. */ - private var filterSheet: CatalogueFilterSheet? = null + private var filterSheet: SourceFilterSheet? = null /** * Recycler view with the list of results. @@ -99,7 +99,7 @@ open class BrowseCatalogueController(bundle: Bundle) : */ private var progressItem: ProgressItem? = null - private lateinit var binding: CatalogueControllerBinding + private lateinit var binding: SourceControllerBinding init { setHasOptionsMenu(true) @@ -109,12 +109,12 @@ open class BrowseCatalogueController(bundle: Bundle) : return presenter.source.name } - override fun createPresenter(): BrowseCataloguePresenter { - return BrowseCataloguePresenter(args.getLong(SOURCE_ID_KEY)) + override fun createPresenter(): BrowseSourcePresenter { + return BrowseSourcePresenter(args.getLong(SOURCE_ID_KEY)) } override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { - binding = CatalogueControllerBinding.inflate(inflater) + binding = SourceControllerBinding.inflate(inflater) return binding.root } @@ -136,7 +136,7 @@ open class BrowseCatalogueController(bundle: Bundle) : return } - filterSheet = CatalogueFilterSheet( + filterSheet = SourceFilterSheet( activity!!, onSearchClicked = { val allDefault = presenter.sourceFilters == presenter.source.getFilterList() @@ -188,17 +188,17 @@ open class BrowseCatalogueController(bundle: Bundle) : addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) } } else { - (binding.catalogueView.inflate(R.layout.catalogue_recycler_autofit) as AutofitRecyclerView).apply { + (binding.catalogueView.inflate(R.layout.source_recycler_autofit) as AutofitRecyclerView).apply { numColumnsSubscription = getColumnsPreferenceForCurrentOrientation().asObservable() .doOnNext { spanCount = it } .skip(1) // Set again the adapter to recalculate the covers height - .subscribe { adapter = this@BrowseCatalogueController.adapter } + .subscribe { adapter = this@BrowseSourceController.adapter } (layoutManager as GridLayoutManager).spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() { override fun getSpanSize(position: Int): Int { return when (adapter?.getItemViewType(position)) { - R.layout.catalogue_grid_item, null -> 1 + R.layout.source_grid_item, null -> 1 else -> spanCount } } @@ -231,7 +231,7 @@ open class BrowseCatalogueController(bundle: Bundle) : } override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - inflater.inflate(R.menu.catalogue_list, menu) + inflater.inflate(R.menu.source_browse, menu) // Initialize search menu val searchItem = menu.findItem(R.id.action_search) @@ -246,7 +246,7 @@ open class BrowseCatalogueController(bundle: Bundle) : val searchEventsObservable = searchView.queryTextChangeEvents() .skip(1) - .filter { router.backstack.lastOrNull()?.controller() == this@BrowseCatalogueController } + .filter { router.backstack.lastOrNull()?.controller() == this@BrowseSourceController } .share() val writingObservable = searchEventsObservable .filter { !it.isSubmitted } @@ -323,7 +323,7 @@ open class BrowseCatalogueController(bundle: Bundle) : * @param page the current page. * @param mangas the list of manga of the page. */ - fun onAddPage(page: Int, mangas: List) { + fun onAddPage(page: Int, mangas: List) { val adapter = adapter ?: return hideProgressBar() if (page == 1) { @@ -434,7 +434,7 @@ open class BrowseCatalogueController(bundle: Bundle) : if (!isListMode || !view.context.connectivityManager.isActiveNetworkMetered) { // Initialize mangas if going to grid view or if over wifi when going to list view val mangas = (0 until adapter.itemCount).mapNotNull { - (adapter.getItem(it) as? CatalogueItem)?.manga + (adapter.getItem(it) as? SourceItem)?.manga } presenter.initializeMangas(mangas) } @@ -458,13 +458,13 @@ open class BrowseCatalogueController(bundle: Bundle) : * @param manga the manga to find. * @return the holder of the manga or null if it's not bound. */ - private fun getHolder(manga: Manga): CatalogueHolder? { + private fun getHolder(manga: Manga): SourceHolder? { val adapter = adapter ?: return null adapter.allBoundViewHolders.forEach { holder -> - val item = adapter.getItem(holder.adapterPosition) as? CatalogueItem + val item = adapter.getItem(holder.adapterPosition) as? SourceItem if (item != null && item.manga.id!! == manga.id!!) { - return holder as CatalogueHolder + return holder as SourceHolder } } @@ -495,7 +495,7 @@ open class BrowseCatalogueController(bundle: Bundle) : * @return true if the item should be selected, false otherwise. */ override fun onItemClick(view: View, position: Int): Boolean { - val item = adapter?.getItem(position) as? CatalogueItem ?: return false + val item = adapter?.getItem(position) as? SourceItem ?: return false router.pushController(MangaController(item.manga, true).withFadeTransaction()) return false @@ -512,7 +512,7 @@ open class BrowseCatalogueController(bundle: Bundle) : */ override fun onItemLongClick(position: Int) { val activity = activity ?: return - val manga = (adapter?.getItem(position) as? CatalogueItem?)?.manga ?: return + val manga = (adapter?.getItem(position) as? SourceItem?)?.manga ?: return if (manga.favorite) { MaterialDialog.Builder(activity) @@ -576,7 +576,7 @@ open class BrowseCatalogueController(bundle: Bundle) : presenter.changeMangaFavorite(manga) presenter.updateMangaCategories(manga, categories) - val position = adapter?.currentItems?.indexOfFirst { it -> (it as CatalogueItem).manga.id == manga.id } + val position = adapter?.currentItems?.indexOfFirst { it -> (it as SourceItem).manga.id == manga.id } if (position != null) { adapter?.notifyItemChanged(position) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCataloguePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt similarity index 90% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCataloguePresenter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt index f34c70424..ed2aac8e4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCataloguePresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.os.Bundle import eu.davidea.flexibleadapter.items.IFlexible @@ -15,19 +15,19 @@ import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.ui.catalogue.filter.CheckboxItem -import eu.kanade.tachiyomi.ui.catalogue.filter.CheckboxSectionItem -import eu.kanade.tachiyomi.ui.catalogue.filter.GroupItem -import eu.kanade.tachiyomi.ui.catalogue.filter.HeaderItem -import eu.kanade.tachiyomi.ui.catalogue.filter.SelectItem -import eu.kanade.tachiyomi.ui.catalogue.filter.SelectSectionItem -import eu.kanade.tachiyomi.ui.catalogue.filter.SeparatorItem -import eu.kanade.tachiyomi.ui.catalogue.filter.SortGroup -import eu.kanade.tachiyomi.ui.catalogue.filter.SortItem -import eu.kanade.tachiyomi.ui.catalogue.filter.TextItem -import eu.kanade.tachiyomi.ui.catalogue.filter.TextSectionItem -import eu.kanade.tachiyomi.ui.catalogue.filter.TriStateItem -import eu.kanade.tachiyomi.ui.catalogue.filter.TriStateSectionItem +import eu.kanade.tachiyomi.ui.source.filter.CheckboxItem +import eu.kanade.tachiyomi.ui.source.filter.CheckboxSectionItem +import eu.kanade.tachiyomi.ui.source.filter.GroupItem +import eu.kanade.tachiyomi.ui.source.filter.HeaderItem +import eu.kanade.tachiyomi.ui.source.filter.SelectItem +import eu.kanade.tachiyomi.ui.source.filter.SelectSectionItem +import eu.kanade.tachiyomi.ui.source.filter.SeparatorItem +import eu.kanade.tachiyomi.ui.source.filter.SortGroup +import eu.kanade.tachiyomi.ui.source.filter.SortItem +import eu.kanade.tachiyomi.ui.source.filter.TextItem +import eu.kanade.tachiyomi.ui.source.filter.TextSectionItem +import eu.kanade.tachiyomi.ui.source.filter.TriStateItem +import eu.kanade.tachiyomi.ui.source.filter.TriStateSectionItem import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers @@ -38,15 +38,15 @@ import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get /** - * Presenter of [BrowseCatalogueController]. + * Presenter of [BrowseSourceController]. */ -open class BrowseCataloguePresenter( +open class BrowseSourcePresenter( sourceId: Long, sourceManager: SourceManager = Injekt.get(), private val db: DatabaseHelper = Injekt.get(), private val prefs: PreferencesHelper = Injekt.get(), private val coverCache: CoverCache = Injekt.get() -) : BasePresenter() { +) : BasePresenter() { /** * Selected source. @@ -151,7 +151,7 @@ open class BrowseCataloguePresenter( .observeOn(Schedulers.io()) .map { it.first to it.second.map { networkToLocalManga(it, sourceId) } } .doOnNext { initializeMangas(it.second) } - .map { it.first to it.second.map { CatalogueItem(it, catalogueAsList) } } + .map { it.first to it.second.map { SourceItem(it, catalogueAsList) } } .observeOn(AndroidSchedulers.mainThread()) .subscribeReplay({ view, (page, mangas) -> view.onAddPage(page, mangas) @@ -173,7 +173,7 @@ open class BrowseCataloguePresenter( pageSubscription = Observable.defer { pager.requestNext() } .subscribeFirst({ _, _ -> // Nothing to do when onNext is emitted. - }, BrowseCatalogueController::onAddPageError) + }, BrowseSourceController::onAddPageError) } /** @@ -288,7 +288,7 @@ open class BrowseCataloguePresenter( } open fun createPager(query: String, filters: FilterList): Pager { - return CataloguePager(source, query, filters) + return SourcePager(source, query, filters) } private fun FilterList.toItems(): List> { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt new file mode 100644 index 000000000..744718def --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt @@ -0,0 +1,3 @@ +package eu.kanade.tachiyomi.ui.source.browse + +class NoResultsException : Exception() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/Pager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt similarity index 94% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/Pager.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt index 62b88aa85..378839f7a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/Pager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/Pager.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import com.jakewharton.rxrelay.PublishRelay import eu.kanade.tachiyomi.source.model.MangasPage diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt similarity index 94% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt index 7b4aa0329..91f5d825e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/ProgressItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/ProgressItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import android.widget.ProgressBar @@ -17,7 +17,7 @@ class ProgressItem : AbstractFlexibleItem() { private var loadMore = true override fun getLayoutRes(): Int { - return R.layout.catalogue_progress_item + return R.layout.source_progress_item } override fun createViewHolder(view: View, adapter: FlexibleAdapter>): Holder { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueFilterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt similarity index 85% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueFilterSheet.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt index f459807a4..de43b828a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueFilterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceFilterSheet.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.app.Activity import android.content.Context @@ -10,10 +10,10 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.widget.SimpleNavigationView -import kotlinx.android.synthetic.main.catalogue_drawer_content.view.reset_btn -import kotlinx.android.synthetic.main.catalogue_drawer_content.view.search_btn +import kotlinx.android.synthetic.main.source_filter_sheet.view.reset_btn +import kotlinx.android.synthetic.main.source_filter_sheet.view.search_btn -class CatalogueFilterSheet( +class SourceFilterSheet( activity: Activity, onSearchClicked: () -> Unit, onResetClicked: () -> Unit @@ -49,7 +49,7 @@ class CatalogueFilterSheet( init { recycler.adapter = adapter recycler.setHasFixedSize(true) - val view = inflate(R.layout.catalogue_drawer_content) + val view = inflate(R.layout.source_filter_sheet) ((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler) addView(view) search_btn.setOnClickListener { onSearchClicked() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt similarity index 75% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt index fd670bd0e..6cf49dc3c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceGridHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import com.bumptech.glide.load.engine.DiskCacheStrategy @@ -6,20 +6,20 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.catalogue_grid_item.progress -import kotlinx.android.synthetic.main.catalogue_grid_item.thumbnail -import kotlinx.android.synthetic.main.catalogue_grid_item.title +import kotlinx.android.synthetic.main.source_grid_item.progress +import kotlinx.android.synthetic.main.source_grid_item.thumbnail +import kotlinx.android.synthetic.main.source_grid_item.title /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. - * All the elements from the layout file "item_catalogue_grid" are available in this class. + * All the elements from the layout file "item_source_grid" are available in this class. * * @param view the inflated view for this holder. * @param adapter the adapter handling this holder. * @constructor creates a new catalogue holder. */ -class CatalogueGridHolder(private val view: View, private val adapter: FlexibleAdapter<*>) : - CatalogueHolder(view, adapter) { +class SourceGridHolder(private val view: View, private val adapter: FlexibleAdapter<*>) : + SourceHolder(view, adapter) { /** * Method called from [CatalogueAdapter.onBindViewHolder]. It updates the data for this diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt similarity index 88% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt index 62b7ae426..f0dc346c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import eu.davidea.flexibleadapter.FlexibleAdapter @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder * @param view the inflated view for this holder. * @param adapter the adapter handling this holder. */ -abstract class CatalogueHolder(view: View, adapter: FlexibleAdapter<*>) : +abstract class SourceHolder(view: View, adapter: FlexibleAdapter<*>) : BaseFlexibleViewHolder(view, adapter) { /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt similarity index 74% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt index 92c4ed915..d12788c41 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.Gravity import android.view.View @@ -13,23 +13,23 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.catalogue_grid_item.view.card -import kotlinx.android.synthetic.main.catalogue_grid_item.view.gradient +import kotlinx.android.synthetic.main.source_grid_item.view.card +import kotlinx.android.synthetic.main.source_grid_item.view.gradient -class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference) : - AbstractFlexibleItem() { +class SourceItem(val manga: Manga, private val catalogueAsList: Preference) : + AbstractFlexibleItem() { override fun getLayoutRes(): Int { return if (catalogueAsList.getOrDefault()) - R.layout.catalogue_list_item + R.layout.source_list_item else - R.layout.catalogue_grid_item + R.layout.source_grid_item } override fun createViewHolder( view: View, adapter: FlexibleAdapter> - ): CatalogueHolder { + ): SourceHolder { val parent = adapter.recyclerView return if (parent is AutofitRecyclerView) { view.apply { @@ -38,15 +38,15 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference>, - holder: CatalogueHolder, + holder: SourceHolder, position: Int, payloads: List? ) { @@ -55,7 +55,7 @@ class CatalogueItem(val manga: Manga, private val catalogueAsList: Preference) : - CatalogueHolder(view, adapter) { +class SourceListHolder(private val view: View, adapter: FlexibleAdapter<*>) : + SourceHolder(view, adapter) { private val favoriteColor = view.context.getResourceColor(android.R.attr.textColorHint) private val unfavoriteColor = view.context.getResourceColor(android.R.attr.textColorPrimary) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CataloguePager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt similarity index 85% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CataloguePager.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt index 08dad01c2..ea9e050d9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CataloguePager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourcePager.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.model.FilterList @@ -7,7 +7,7 @@ import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers -open class CataloguePager(val source: CatalogueSource, val query: String, val filters: FilterList) : Pager() { +open class SourcePager(val source: CatalogueSource, val query: String, val filters: FilterList) : Pager() { override fun requestNext(): Observable { val page = currentPage diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt index cbd9e0341..7e63267cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/CheckboxItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/CheckboxItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.CheckBox diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt index 7eefcca93..214f0c0c1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/GroupItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/GroupItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.ImageView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt similarity index 96% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt index 034073982..e04cd55c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/HeaderItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/HeaderItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.annotation.SuppressLint import android.view.View diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SectionItems.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SectionItems.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt index 27e1efa5e..5ce745e03 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SectionItems.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SectionItems.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import eu.davidea.flexibleadapter.items.ISectionable import eu.kanade.tachiyomi.source.model.Filter diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt index 704275152..0ded86435 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SelectItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SelectItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.ArrayAdapter diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt similarity index 96% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt index ff9fde695..8b07d0838 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SeparatorItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SeparatorItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.annotation.SuppressLint import android.view.View diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt index 1fe5603f1..73c96f224 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortGroup.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortGroup.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import androidx.recyclerview.widget.RecyclerView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt index 2e8b92d3f..ae557773d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/SortItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/SortItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.CheckedTextView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt similarity index 97% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt index 60f6c62a4..86b1cc8d6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TextItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TextItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.EditText diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt index 4cf52397f..53d5bf68c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/filter/TriStateItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/filter/TriStateItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.filter +package eu.kanade.tachiyomi.ui.source.filter import android.view.View import android.widget.CheckedTextView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt similarity index 89% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt index 946b3a03c..c65dc7945 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchAdapter.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import android.os.Bundle import android.os.Parcelable @@ -9,10 +9,10 @@ import eu.davidea.flexibleadapter.FlexibleAdapter /** * Adapter that holds the search cards. * - * @param controller instance of [CatalogueSearchController]. + * @param controller instance of [GlobalSearchController]. */ -class CatalogueSearchAdapter(val controller: CatalogueSearchController) : - FlexibleAdapter(null, controller, true) { +class GlobalSearchAdapter(val controller: GlobalSearchController) : + FlexibleAdapter(null, controller, true) { /** * Bundle where the view state of the holders is saved. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardAdapter.kt similarity index 60% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardAdapter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardAdapter.kt index 6ed918079..c684ab257 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardAdapter.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import eu.davidea.flexibleadapter.FlexibleAdapter import eu.kanade.tachiyomi.data.database.models.Manga @@ -6,10 +6,10 @@ import eu.kanade.tachiyomi.data.database.models.Manga /** * Adapter that holds the manga items from search results. * - * @param controller instance of [CatalogueSearchController]. + * @param controller instance of [GlobalSearchController]. */ -class CatalogueSearchCardAdapter(controller: CatalogueSearchController) : - FlexibleAdapter(null, controller, true) { +class GlobalSearchCardAdapter(controller: GlobalSearchController) : + FlexibleAdapter(null, controller, true) { /** * Listen for browse item clicks. @@ -18,7 +18,7 @@ class CatalogueSearchCardAdapter(controller: CatalogueSearchController) : /** * Listener which should be called when user clicks browse. - * Note: Should only be handled by [CatalogueSearchController] + * Note: Should only be handled by [GlobalSearchController] */ interface OnMangaClickListener { fun onMangaClick(manga: Manga) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt similarity index 79% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt index c7125195f..55ae253ac 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import android.view.View import com.bumptech.glide.load.engine.DiskCacheStrategy @@ -6,11 +6,11 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card_item.itemImage -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card_item.progress -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card_item.tvTitle +import kotlinx.android.synthetic.main.global_search_controller_card_item.itemImage +import kotlinx.android.synthetic.main.global_search_controller_card_item.progress +import kotlinx.android.synthetic.main.global_search_controller_card_item.tvTitle -class CatalogueSearchCardHolder(view: View, adapter: CatalogueSearchCardAdapter) : +class GlobalSearchCardHolder(view: View, adapter: GlobalSearchCardAdapter) : BaseFlexibleViewHolder(view, adapter) { init { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardItem.kt similarity index 64% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardItem.kt index 640bc5b33..fdcf85cdc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchCardItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchCardItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -8,19 +8,19 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga -class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem() { +class GlobalSearchCardItem(val manga: Manga) : AbstractFlexibleItem() { override fun getLayoutRes(): Int { - return R.layout.catalogue_global_search_controller_card_item + return R.layout.global_search_controller_card_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueSearchCardHolder { - return CatalogueSearchCardHolder(view, adapter as CatalogueSearchCardAdapter) + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): GlobalSearchCardHolder { + return GlobalSearchCardHolder(view, adapter as GlobalSearchCardAdapter) } override fun bindViewHolder( adapter: FlexibleAdapter>, - holder: CatalogueSearchCardHolder, + holder: GlobalSearchCardHolder, position: Int, payloads: List? ) { @@ -28,7 +28,7 @@ class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem(), - CatalogueSearchCardAdapter.OnMangaClickListener { +) : NucleusController(), + GlobalSearchCardAdapter.OnMangaClickListener { /** * Adapter containing search results grouped by lang. */ - protected var adapter: CatalogueSearchAdapter? = null + protected var adapter: GlobalSearchAdapter? = null - private lateinit var binding: CatalogueGlobalSearchControllerBinding + private lateinit var binding: GlobalSearchControllerBinding /** * Called when controller is initialized. @@ -44,14 +44,14 @@ open class CatalogueSearchController( } /** - * Initiate the view with [R.layout.catalogue_global_search_controller]. + * Initiate the view with [R.layout.global_search_controller]. * * @param inflater used to load the layout xml. * @param container containing parent views. * @return inflated view */ override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { - binding = CatalogueGlobalSearchControllerBinding.inflate(inflater) + binding = GlobalSearchControllerBinding.inflate(inflater) return binding.root } @@ -65,12 +65,12 @@ open class CatalogueSearchController( } /** - * Create the [CatalogueSearchPresenter] used in controller. + * Create the [GlobalSearchPresenter] used in controller. * - * @return instance of [CatalogueSearchPresenter] + * @return instance of [GlobalSearchPresenter] */ - override fun createPresenter(): CatalogueSearchPresenter { - return CatalogueSearchPresenter(initialQuery, extensionFilter) + override fun createPresenter(): GlobalSearchPresenter { + return GlobalSearchPresenter(initialQuery, extensionFilter) } /** @@ -101,7 +101,7 @@ open class CatalogueSearchController( */ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { // Inflate menu. - inflater.inflate(R.menu.catalogue_new_list, menu) + inflater.inflate(R.menu.global_search, menu) // Initialize search menu val searchItem = menu.findItem(R.id.action_search) @@ -136,7 +136,7 @@ open class CatalogueSearchController( override fun onViewCreated(view: View) { super.onViewCreated(view) - adapter = CatalogueSearchAdapter(this) + adapter = GlobalSearchAdapter(this) // Create recycler and set adapter. binding.recycler.layoutManager = LinearLayoutManager(view.context) @@ -164,13 +164,13 @@ open class CatalogueSearchController( * @param source used to find holder containing source * @return the holder of the manga or null if it's not bound. */ - private fun getHolder(source: CatalogueSource): CatalogueSearchHolder? { + private fun getHolder(source: CatalogueSource): GlobalSearchHolder? { val adapter = adapter ?: return null adapter.allBoundViewHolders.forEach { holder -> val item = adapter.getItem(holder.adapterPosition) if (item != null && source.id == item.source.id) { - return holder as CatalogueSearchHolder + return holder as GlobalSearchHolder } } @@ -182,7 +182,7 @@ open class CatalogueSearchController( * * @param searchResult result of search. */ - fun setItems(searchResult: List) { + fun setItems(searchResult: List) { adapter?.updateDataSet(searchResult) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt similarity index 70% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt index 3239638c5..8fb28fcee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import android.view.View import androidx.recyclerview.widget.LinearLayoutManager @@ -6,26 +6,26 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.visible -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.progress -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.recycler -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.source_card -import kotlinx.android.synthetic.main.catalogue_global_search_controller_card.title +import kotlinx.android.synthetic.main.global_search_controller_card.progress +import kotlinx.android.synthetic.main.global_search_controller_card.recycler +import kotlinx.android.synthetic.main.global_search_controller_card.source_card +import kotlinx.android.synthetic.main.global_search_controller_card.title /** - * Holder that binds the [CatalogueSearchItem] containing catalogue cards. + * Holder that binds the [GlobalSearchItem] containing catalogue cards. * - * @param view view of [CatalogueSearchItem] - * @param adapter instance of [CatalogueSearchAdapter] + * @param view view of [GlobalSearchItem] + * @param adapter instance of [GlobalSearchAdapter] */ -class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : +class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) : BaseFlexibleViewHolder(view, adapter) { /** * Adapter containing manga from search results. */ - private val mangaAdapter = CatalogueSearchCardAdapter(adapter.controller) + private val mangaAdapter = GlobalSearchCardAdapter(adapter.controller) - private var lastBoundResults: List? = null + private var lastBoundResults: List? = null init { // Set layout horizontal. @@ -38,7 +38,7 @@ class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : * * @param item item of card. */ - fun bind(item: CatalogueSearchItem) { + fun bind(item: GlobalSearchItem) { val source = item.source val results = item.results @@ -83,11 +83,11 @@ class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : * @param manga the manga to find. * @return the holder of the manga or null if it's not bound. */ - private fun getHolder(manga: Manga): CatalogueSearchCardHolder? { + private fun getHolder(manga: Manga): GlobalSearchCardHolder? { mangaAdapter.allBoundViewHolders.forEach { holder -> val item = mangaAdapter.getItem(holder.adapterPosition) if (item != null && item.manga.id!! == manga.id!!) { - return holder as CatalogueSearchCardHolder + return holder as GlobalSearchCardHolder } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchItem.kt similarity index 70% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchItem.kt index bd284f485..14ec8617f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/global_search/GlobalSearchItem.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.global_search +package eu.kanade.tachiyomi.ui.source.global_search import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.source.CatalogueSource * @param results the search results. * @param highlighted whether this search item should be highlighted/marked in the catalogue search view. */ -class CatalogueSearchItem(val source: CatalogueSource, val results: List?, val highlighted: Boolean = false) : - AbstractFlexibleItem() { +class GlobalSearchItem(val source: CatalogueSource, val results: List?, val highlighted: Boolean = false) : + AbstractFlexibleItem() { /** * Set view. @@ -24,16 +24,16 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List>): CatalogueSearchHolder { - return CatalogueSearchHolder(view, adapter as CatalogueSearchAdapter) + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): GlobalSearchHolder { + return GlobalSearchHolder(view, adapter as GlobalSearchAdapter) } /** @@ -41,7 +41,7 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List>, - holder: CatalogueSearchHolder, + holder: GlobalSearchHolder, position: Int, payloads: List? ) { @@ -54,7 +54,7 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List() { +) : BasePresenter() { /** * Enabled sources. @@ -73,11 +73,11 @@ open class CatalogueSearchPresenter( override fun onCreate(savedState: Bundle?) { super.onCreate(savedState) - extensionFilter = savedState?.getString(CatalogueSearchPresenter::extensionFilter.name) + extensionFilter = savedState?.getString(GlobalSearchPresenter::extensionFilter.name) ?: initialExtensionFilter // Perform a search with previous or initial state - search(savedState?.getString(BrowseCataloguePresenter::query.name) + search(savedState?.getString(BrowseSourcePresenter::query.name) ?: initialQuery.orEmpty()) } @@ -88,8 +88,8 @@ open class CatalogueSearchPresenter( } override fun onSave(state: Bundle) { - state.putString(BrowseCataloguePresenter::query.name, query) - state.putString(CatalogueSearchPresenter::extensionFilter.name, extensionFilter) + state.putString(BrowseSourcePresenter::query.name, query) + state.putString(GlobalSearchPresenter::extensionFilter.name, extensionFilter) super.onSave(state) } @@ -133,8 +133,8 @@ open class CatalogueSearchPresenter( /** * Creates a catalogue search item */ - protected open fun createCatalogueSearchItem(source: CatalogueSource, results: List?): CatalogueSearchItem { - return CatalogueSearchItem(source, results) + protected open fun createCatalogueSearchItem(source: CatalogueSource, results: List?): GlobalSearchItem { + return GlobalSearchItem(source, results) } /** @@ -165,7 +165,7 @@ open class CatalogueSearchPresenter( .map { it.mangas.take(10) } // Get at most 10 manga from search result. .map { it.map { networkToLocalManga(it, source.id) } } // Convert to local manga. .doOnNext { fetchImage(it, source) } // Load manga covers. - .map { createCatalogueSearchItem(source, it.map { CatalogueSearchCardItem(it) }) } + .map { createCatalogueSearchItem(source, it.map { GlobalSearchCardItem(it) }) } }, 5) .observeOn(AndroidSchedulers.mainThread()) // Update matching source with the obtained results diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt similarity index 63% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt index 47ea383de..4842dcdf8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesController.kt @@ -1,22 +1,22 @@ -package eu.kanade.tachiyomi.ui.catalogue.latest +package eu.kanade.tachiyomi.ui.source.latest import android.os.Bundle import android.view.Menu import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.CatalogueSource -import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController -import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCataloguePresenter +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourcePresenter /** - * Controller that shows the latest manga from the catalogue. Inherit [BrowseCatalogueController]. + * Controller that shows the latest manga from the catalogue. Inherit [BrowseSourceController]. */ -class LatestUpdatesController(bundle: Bundle) : BrowseCatalogueController(bundle) { +class LatestUpdatesController(bundle: Bundle) : BrowseSourceController(bundle) { constructor(source: CatalogueSource) : this(Bundle().apply { putLong(SOURCE_ID_KEY, source.id) }) - override fun createPresenter(): BrowseCataloguePresenter { + override fun createPresenter(): BrowseSourcePresenter { return LatestUpdatesPresenter(args.getLong(SOURCE_ID_KEY)) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt similarity index 85% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPager.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt index 704b375c0..ff908a40b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPager.kt @@ -1,8 +1,8 @@ -package eu.kanade.tachiyomi.ui.catalogue.latest +package eu.kanade.tachiyomi.ui.source.latest import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.model.MangasPage -import eu.kanade.tachiyomi.ui.catalogue.browse.Pager +import eu.kanade.tachiyomi.ui.source.browse.Pager import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt similarity index 50% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPresenter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt index 9b514528a..fbbfa0185 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/latest/LatestUpdatesPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/latest/LatestUpdatesPresenter.kt @@ -1,13 +1,13 @@ -package eu.kanade.tachiyomi.ui.catalogue.latest +package eu.kanade.tachiyomi.ui.source.latest import eu.kanade.tachiyomi.source.model.FilterList -import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCataloguePresenter -import eu.kanade.tachiyomi.ui.catalogue.browse.Pager +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourcePresenter +import eu.kanade.tachiyomi.ui.source.browse.Pager /** * Presenter of [LatestUpdatesController]. Inherit BrowseCataloguePresenter. */ -class LatestUpdatesPresenter(sourceId: Long) : BrowseCataloguePresenter(sourceId) { +class LatestUpdatesPresenter(sourceId: Long) : BrowseSourcePresenter(sourceId) { override fun createPager(query: String, filters: FilterList): Pager { return LatestUpdatesPager(source) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index 2d0703f4b..343630e11 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -7,7 +7,7 @@ import android.os.Build import android.view.ContextThemeWrapper import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.ui.catalogue.CataloguePresenter +import eu.kanade.tachiyomi.ui.source.SourcePresenter import java.util.Locale import uy.kohesive.injekt.injectLazy @@ -51,7 +51,7 @@ object LocaleHelper { return when (lang) { null -> "" "" -> context.getString(R.string.other_source) - CataloguePresenter.PINNED_KEY -> context.getString(R.string.pinned_sources) + SourcePresenter.PINNED_KEY -> context.getString(R.string.pinned_sources) "all" -> context.getString(R.string.all_lang) else -> { val locale = getLocale(lang) diff --git a/app/src/main/res/layout-land/manga_info_controller.xml b/app/src/main/res/layout-land/manga_info_controller.xml index 3b22007ba..4aa2b462b 100644 --- a/app/src/main/res/layout-land/manga_info_controller.xml +++ b/app/src/main/res/layout-land/manga_info_controller.xml @@ -5,7 +5,7 @@ android:id="@id/swipe_refresh" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController"> + tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController"> + tools:listitem="@layout/global_search_controller_card" /> diff --git a/app/src/main/res/layout/catalogue_global_search_controller_card.xml b/app/src/main/res/layout/global_search_controller_card.xml similarity index 95% rename from app/src/main/res/layout/catalogue_global_search_controller_card.xml rename to app/src/main/res/layout/global_search_controller_card.xml index 06a13aaa2..d4d09c522 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller_card.xml +++ b/app/src/main/res/layout/global_search_controller_card.xml @@ -43,7 +43,7 @@ android:orientation="horizontal" android:paddingStart="4dp" android:paddingEnd="4dp" - tools:listitem="@layout/catalogue_global_search_controller_card_item" /> + tools:listitem="@layout/global_search_controller_card_item" /> diff --git a/app/src/main/res/layout/catalogue_global_search_controller_card_item.xml b/app/src/main/res/layout/global_search_controller_card_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_global_search_controller_card_item.xml rename to app/src/main/res/layout/global_search_controller_card_item.xml diff --git a/app/src/main/res/layout/library_grid_recycler.xml b/app/src/main/res/layout/library_grid_recycler.xml index e791e941f..e19a84cd2 100644 --- a/app/src/main/res/layout/library_grid_recycler.xml +++ b/app/src/main/res/layout/library_grid_recycler.xml @@ -2,9 +2,9 @@ + tools:listitem="@layout/source_grid_item" /> diff --git a/app/src/main/res/layout/library_list_recycler.xml b/app/src/main/res/layout/library_list_recycler.xml index 4c7566c6a..85ea95a84 100644 --- a/app/src/main/res/layout/library_list_recycler.xml +++ b/app/src/main/res/layout/library_list_recycler.xml @@ -4,4 +4,4 @@ android:id="@+id/library_list" android:layout_width="match_parent" android:layout_height="match_parent" - tools:listitem="@layout/catalogue_list_item" /> + tools:listitem="@layout/source_list_item" /> diff --git a/app/src/main/res/layout/manga_info_controller.xml b/app/src/main/res/layout/manga_info_controller.xml index a3c2e750d..e84b94250 100644 --- a/app/src/main/res/layout/manga_info_controller.xml +++ b/app/src/main/res/layout/manga_info_controller.xml @@ -5,7 +5,7 @@ android:id="@id/swipe_refresh" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController"> + tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController"> + tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController"> + tools:listitem="@layout/source_main_controller_card" /> + tools:listitem="@layout/source_grid_item" /> diff --git a/app/src/main/res/menu/catalogue_new_list.xml b/app/src/main/res/menu/global_search.xml similarity index 71% rename from app/src/main/res/menu/catalogue_new_list.xml rename to app/src/main/res/menu/global_search.xml index c67527afc..112431a72 100644 --- a/app/src/main/res/menu/catalogue_new_list.xml +++ b/app/src/main/res/menu/global_search.xml @@ -1,7 +1,5 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> + xmlns:app="http://schemas.android.com/apk/res-auto"> + xmlns:app="http://schemas.android.com/apk/res-auto"> outsideOverlay -