From 5871572442e935be5fc1e79ddae1e5a9e32cf595 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 19 Apr 2020 04:33:57 -0400 Subject: [PATCH] Renaming a bunch of files as Source instead of Catalogue --- README.md | 2 +- .../data/preference/PreferencesHelper.kt | 4 +- .../browse/CatalogueNavigationView.kt | 41 -------------- .../ui/catalogue/browse/NoResultsException.kt | 3 -- .../ui/extension/ExtensionBottomSheet.kt | 6 +-- .../tachiyomi/ui/library/LibraryGridHolder.kt | 2 +- .../tachiyomi/ui/library/LibraryItem.kt | 6 +-- .../tachiyomi/ui/library/LibraryListHolder.kt | 4 +- .../kanade/tachiyomi/ui/main/MainActivity.kt | 16 +++--- .../tachiyomi/ui/main/SearchActivity.kt | 6 +-- .../ui/manga/MangaDetailsController.kt | 4 +- .../tachiyomi/ui/migration/MangaHolder.kt | 2 +- .../tachiyomi/ui/migration/MangaItem.kt | 2 +- .../ui/migration/SearchController.kt | 8 +-- .../tachiyomi/ui/migration/SearchPresenter.kt | 12 ++--- .../tachiyomi/ui/migration/SelectionHeader.kt | 4 +- .../tachiyomi/ui/migration/SourceHolder.kt | 6 +-- .../manga/design/PreMigrationController.kt | 2 +- .../manga/process/MigrationProcessHolder.kt | 2 +- .../recently_read/RecentlyReadController.kt | 2 +- .../ui/setting/SettingsSourcesController.kt | 12 ++--- .../ui/{catalogue => source}/LangHolder.kt | 4 +- .../ui/{catalogue => source}/LangItem.kt | 4 +- .../SourceAdapter.kt} | 10 ++-- .../SourceController.kt} | 50 ++++++++--------- .../SourceDividerItemDecoration.kt | 2 +- .../ui/{catalogue => source}/SourceHolder.kt | 6 +-- .../ui/{catalogue => source}/SourceItem.kt | 6 +-- .../SourcePresenter.kt} | 14 ++--- .../browse/BrowseSourceController.kt} | 53 ++++++++----------- .../browse/BrowseSourceGridHolder.kt} | 8 +-- .../browse/BrowseSourceHolder.kt} | 4 +- .../browse/BrowseSourceItem.kt} | 22 ++++---- .../browse/BrowseSourceListHolder.kt} | 8 +-- .../browse/BrowseSourcePager.kt} | 4 +- .../browse/BrowseSourcePresenter.kt} | 48 ++++++++--------- .../ui/source/browse/NoResultsException.kt | 3 ++ .../ui/{catalogue => source}/browse/Pager.kt | 2 +- .../browse/ProgressItem.kt | 4 +- .../browse/SourceSearchSheet.kt} | 8 +-- .../filter/CheckboxItem.kt | 2 +- .../{catalogue => source}/filter/GroupItem.kt | 2 +- .../filter/HeaderItem.kt | 2 +- .../filter/SectionItems.kt | 2 +- .../filter/SelectItem.kt | 2 +- .../filter/SeparatorItem.kt | 2 +- .../{catalogue => source}/filter/SortGroup.kt | 2 +- .../{catalogue => source}/filter/SortItem.kt | 2 +- .../{catalogue => source}/filter/TextItem.kt | 2 +- .../filter/TriStateItem.kt | 2 +- .../global_search/SourceSearchAdapter.kt} | 8 +-- .../global_search/SourceSearchCardAdapter.kt} | 10 ++-- .../global_search/SourceSearchCardHolder.kt} | 6 +-- .../global_search/SourceSearchCardItem.kt} | 14 ++--- .../global_search/SourceSearchController.kt} | 36 ++++++------- .../global_search/SourceSearchHolder.kt} | 23 ++++---- .../global_search/SourceSearchItem.kt} | 18 +++---- .../global_search/SourceSearchPresenter.kt} | 34 ++++++------ .../latest/LatestUpdatesController.kt | 14 ++--- .../latest/LatestUpdatesPager.kt | 4 +- .../latest/LatestUpdatesPresenter.kt | 8 +-- .../tachiyomi/util/system/LocaleHelper.kt | 4 +- ...oller.xml => browse_source_controller.xml} | 4 +- .../main/res/layout/library_grid_recycler.xml | 2 +- ...ogue_grid_item.xml => manga_grid_item.xml} | 0 ...ogue_list_item.xml => manga_list_item.xml} | 0 ...autofit.xml => manga_recycler_autofit.xml} | 2 +- .../res/layout/migration_process_item.xml | 4 +- ...n_controller.xml => source_controller.xml} | 2 +- ...lter_sheet.xml => source_filter_sheet.xml} | 0 ...ml => source_global_search_controller.xml} | 2 +- ... source_global_search_controller_card.xml} | 2 +- ...ce_global_search_controller_card_item.xml} | 0 ...roller_card.xml => source_header_item.xml} | 0 ...ntroller_card_item.xml => source_item.xml} | 0 ...ress_item.xml => source_progress_item.xml} | 0 76 files changed, 287 insertions(+), 336 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/NoResultsException.kt rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/LangHolder.kt (83%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/LangItem.kt (91%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/CatalogueAdapter.kt => source/SourceAdapter.kt} (78%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/CatalogueController.kt => source/SourceController.kt} (89%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/SourceDividerItemDecoration.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/SourceHolder.kt (86%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/SourceItem.kt (88%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/CataloguePresenter.kt => source/SourcePresenter.kt} (90%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/BrowseCatalogueController.kt => source/browse/BrowseSourceController.kt} (91%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CatalogueGridHolder.kt => source/browse/BrowseSourceGridHolder.kt} (93%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CatalogueHolder.kt => source/browse/BrowseSourceHolder.kt} (86%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CatalogueItem.kt => source/browse/BrowseSourceItem.kt} (86%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CatalogueListHolder.kt => source/browse/BrowseSourceListHolder.kt} (88%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CataloguePager.kt => source/browse/BrowseSourcePager.kt} (85%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/BrowseCataloguePresenter.kt => source/browse/BrowseSourcePresenter.kt} (89%) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/NoResultsException.kt rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/browse/Pager.kt (94%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/browse/ProgressItem.kt (94%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/browse/CatalogueSearchSheet.kt => source/browse/SourceSearchSheet.kt} (93%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/CheckboxItem.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/GroupItem.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/HeaderItem.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/SectionItems.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/SelectItem.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/SeparatorItem.kt (96%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/SortGroup.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/SortItem.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/TextItem.kt (97%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/filter/TriStateItem.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchAdapter.kt => source/global_search/SourceSearchAdapter.kt} (89%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchCardAdapter.kt => source/global_search/SourceSearchCardAdapter.kt} (60%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchCardHolder.kt => source/global_search/SourceSearchCardHolder.kt} (87%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchCardItem.kt => source/global_search/SourceSearchCardItem.kt} (64%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchController.kt => source/global_search/SourceSearchController.kt} (84%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchHolder.kt => source/global_search/SourceSearchHolder.kt} (75%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchItem.kt => source/global_search/SourceSearchItem.kt} (70%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue/global_search/CatalogueSearchPresenter.kt => source/global_search/SourceSearchPresenter.kt} (88%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/latest/LatestUpdatesController.kt (62%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/latest/LatestUpdatesPager.kt (85%) rename app/src/main/java/eu/kanade/tachiyomi/ui/{catalogue => source}/latest/LatestUpdatesPresenter.kt (50%) rename app/src/main/res/layout/{catalogue_controller.xml => browse_source_controller.xml} (92%) rename app/src/main/res/layout/{catalogue_grid_item.xml => manga_grid_item.xml} (100%) rename app/src/main/res/layout/{catalogue_list_item.xml => manga_list_item.xml} (100%) rename app/src/main/res/layout/{catalogue_recycler_autofit.xml => manga_recycler_autofit.xml} (82%) rename app/src/main/res/layout/{catalogue_main_controller.xml => source_controller.xml} (95%) rename app/src/main/res/layout/{catalogue_filter_sheet.xml => source_filter_sheet.xml} (100%) rename app/src/main/res/layout/{catalogue_global_search_controller.xml => source_global_search_controller.xml} (88%) rename app/src/main/res/layout/{catalogue_global_search_controller_card.xml => source_global_search_controller_card.xml} (95%) rename app/src/main/res/layout/{catalogue_global_search_controller_card_item.xml => source_global_search_controller_card_item.xml} (100%) rename app/src/main/res/layout/{catalogue_main_controller_card.xml => source_header_item.xml} (100%) rename app/src/main/res/layout/{catalogue_main_controller_card_item.xml => source_item.xml} (100%) rename app/src/main/res/layout/{catalogue_progress_item.xml => source_progress_item.xml} (100%) diff --git a/README.md b/README.md index 65d302f082..e75fb1b910 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ DON'T: https://github.com/inorichi/tachiyomi/issues/75 * Write a detailed issue, explaning what it should do or how. Avoid writing just "like X app does" * Include screenshot (if needed) -Catalogue requests should be created at https://github.com/inorichi/tachiyomi-extensions, they do not belong in this repository. +Source requests should be created at https://github.com/inorichi/tachiyomi-extensions, they do not belong in this repository. ## FAQ diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 76f5cb81b0..0823a6b165 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -115,7 +115,7 @@ class PreferencesHelper(val context: Context) { fun lastVersionCode() = rxPrefs.getInteger("last_version_code", 0) - fun catalogueAsList() = rxPrefs.getBoolean(Keys.catalogueAsList, false) + fun browseAsList() = rxPrefs.getBoolean(Keys.catalogueAsList, false) fun enabledLanguages() = rxPrefs.getStringSet(Keys.enabledLanguages, setOf("en", Locale.getDefault().language)) @@ -205,7 +205,7 @@ class PreferencesHelper(val context: Context) { fun collapsedCategories() = rxPrefs.getStringSet("collapsed_categories", mutableSetOf()) - fun hiddenCatalogues() = rxPrefs.getStringSet("hidden_catalogues", mutableSetOf()) + fun hiddenSources() = rxPrefs.getStringSet("hidden_catalogues", mutableSetOf()) fun pinnedCatalogues() = rxPrefs.getStringSet("pinned_catalogues", emptySet()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt deleted file mode 100644 index 84a3fb0972..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueNavigationView.kt +++ /dev/null @@ -1,41 +0,0 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse - -import android.content.Context -import android.util.AttributeSet -import android.view.ViewGroup -import eu.davidea.flexibleadapter.FlexibleAdapter -import eu.davidea.flexibleadapter.items.IFlexible -import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.view.inflate -import eu.kanade.tachiyomi.widget.SimpleNavigationView - -class CatalogueNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : - SimpleNavigationView(context, attrs) { - - val adapter: FlexibleAdapter> = FlexibleAdapter>(null) - .setDisplayHeadersAtStartUp(true) - .setStickyHeaders(true) - - var onSearchClicked = {} - - var onResetClicked = {} - - init { - recycler.adapter = adapter - recycler.setHasFixedSize(true) - val view = inflate(R.layout.catalogue_filter_sheet) - ((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler) - addView(view) - // title.text = context.getString(R.string.source_search_options) - /*search_btn.setOnClickListener { onSearchClicked() } - reset_btn.setOnClickListener { onResetClicked() } - view.search_layout.setOnApplyWindowInsetsListener { v, insets -> - view.updatePaddingRelative(bottom = insets.systemWindowInsetBottom) - insets - }*/ - } - - fun setFilters(items: List>) { - adapter.updateDataSet(items) - } -} 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 ae6f39bcda..0000000000 --- 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/extension/ExtensionBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomSheet.kt index e3019f6158..ee455be9c8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomSheet.kt @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.CatalogueController +import eu.kanade.tachiyomi.ui.source.SourceController import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets @@ -44,9 +44,9 @@ ExtensionAdapter.OnButtonClickListener, private var extensions: List = emptyList() - lateinit var controller: CatalogueController + lateinit var controller: SourceController - fun onCreate(controller: CatalogueController) { + fun onCreate(controller: SourceController) { // Initialize adapter, scroll listener and recycler views autoCheckItem = AutoCheckItem(presenter.getAutoCheckPref()) adapter = ExtensionAdapter(this) 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 8a15ff00c6..6482139f33 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 @@ -9,7 +9,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.MangaImpl import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.util.view.gone -import kotlinx.android.synthetic.main.catalogue_grid_item.* +import kotlinx.android.synthetic.main.manga_grid_item.* import kotlinx.android.synthetic.main.unread_download_badge.* /** 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 55c9234f46..ee54c8b3af 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 @@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.catalogue_grid_item.view.* +import kotlinx.android.synthetic.main.manga_grid_item.view.* import uy.kohesive.injekt.injectLazy class LibraryItem( @@ -39,9 +39,9 @@ class LibraryItem( override fun getLayoutRes(): Int { return if (libraryLayout.getOrDefault() == 0 || manga.isBlank()) - R.layout.catalogue_list_item + R.layout.manga_list_item else - R.layout.catalogue_grid_item + R.layout.manga_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 6c9b0408a8..2ddcebf2e0 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 @@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.visible -import kotlinx.android.synthetic.main.catalogue_list_item.* -import kotlinx.android.synthetic.main.catalogue_list_item.view.* +import kotlinx.android.synthetic.main.manga_list_item.* +import kotlinx.android.synthetic.main.manga_list_item.view.* import kotlinx.android.synthetic.main.unread_download_badge.* /** 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 0dfede35f2..79765ff8f3 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 @@ -45,8 +45,6 @@ import eu.kanade.tachiyomi.ui.base.activity.BaseActivity import eu.kanade.tachiyomi.ui.base.controller.BaseController import eu.kanade.tachiyomi.ui.base.controller.DialogController 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.library.LibraryController import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController @@ -55,6 +53,8 @@ import eu.kanade.tachiyomi.ui.recents.RecentsController import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.ui.setting.SettingsMainController +import eu.kanade.tachiyomi.ui.source.SourceController +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchController import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets @@ -152,7 +152,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { setRoot(when (id) { R.id.nav_library -> LibraryController() R.id.nav_recents -> RecentsController() - else -> CatalogueController() + else -> SourceController() }, id) } else if (currentRoot.tag()?.toIntOrNull() == id) { if (router.backstackSize == 1) { @@ -368,13 +368,13 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { } router.pushController(controller.withFadeTransaction()) } - SHORTCUT_CATALOGUES -> bottom_nav.selectedItemId = R.id.nav_browse + SHORTCUT_BROWSE -> bottom_nav.selectedItemId = R.id.nav_browse SHORTCUT_EXTENSIONS -> { bottom_nav.selectedItemId = R.id.nav_browse router.popToRoot() bottom_nav.post { val controller = - router.backstack.firstOrNull()?.controller() as? CatalogueController + router.backstack.firstOrNull()?.controller() as? SourceController controller?.showSheet() } } @@ -402,7 +402,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { if (router.backstackSize > 1) { router.popToRoot() } - router.pushController(CatalogueSearchController(query).withFadeTransaction()) + router.pushController(SourceSearchController(query).withFadeTransaction()) } } INTENT_SEARCH -> { @@ -413,7 +413,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { router.popToRoot() } router.pushController( - CatalogueSearchController( + SourceSearchController( query, filter ).withFadeTransaction() @@ -588,7 +588,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { const val SHORTCUT_LIBRARY = "eu.kanade.tachiyomi.SHOW_LIBRARY" const val SHORTCUT_RECENTLY_UPDATED = "eu.kanade.tachiyomi.SHOW_RECENTLY_UPDATED" const val SHORTCUT_RECENTLY_READ = "eu.kanade.tachiyomi.SHOW_RECENTLY_READ" - const val SHORTCUT_CATALOGUES = "eu.kanade.tachiyomi.SHOW_CATALOGUES" + const val SHORTCUT_BROWSE = "eu.kanade.tachiyomi.SHOW_BROWSE" const val SHORTCUT_DOWNLOADS = "eu.kanade.tachiyomi.SHOW_DOWNLOADS" const val SHORTCUT_MANGA = "eu.kanade.tachiyomi.SHOW_MANGA" const val SHORTCUT_EXTENSIONS = "eu.kanade.tachiyomi.EXTENSIONS" diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt index b25034f5ac..26d852bf10 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/SearchActivity.kt @@ -7,7 +7,7 @@ import com.bluelinelabs.conductor.Controller import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchController import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.util.view.gone import kotlinx.android.synthetic.main.main_activity.* @@ -67,7 +67,7 @@ class SearchActivity : MainActivity() { // Get the search query provided in extras, and if not null, perform a global search with it. val query = intent.getStringExtra(SearchManager.QUERY) if (query != null && query.isNotEmpty()) { - router.replaceTopController(CatalogueSearchController(query).withFadeTransaction()) + router.replaceTopController(SourceSearchController(query).withFadeTransaction()) } } INTENT_SEARCH -> { @@ -77,7 +77,7 @@ class SearchActivity : MainActivity() { if (router.backstackSize > 1) { router.popToRoot() } - router.replaceTopController(CatalogueSearchController(query, filter).withFadeTransaction()) + router.replaceTopController(SourceSearchController(query, filter).withFadeTransaction()) } } else -> return false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index 60f5b8a936..0792f48ad5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -83,7 +83,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.controller.BaseController import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.ui.catalogue.CatalogueController +import eu.kanade.tachiyomi.ui.source.SourceController import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.main.MainActivity @@ -136,7 +136,7 @@ class MangaDetailsController : BaseController, constructor( manga: Manga?, fromCatalogue: Boolean = false, - smartSearchConfig: CatalogueController.SmartSearchConfig? = null, + smartSearchConfig: SourceController.SmartSearchConfig? = null, update: Boolean = false ) : super(Bundle().apply { putLong(MANGA_EXTRA, manga?.id ?: 0) 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 9d09649efd..5e8e995d36 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 @@ -7,7 +7,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import kotlinx.android.synthetic.main.catalogue_list_item.* +import kotlinx.android.synthetic.main.manga_list_item.* 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 76636b7d8e..68ff99c148 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.manga_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 93efd4694e..6c923d520c 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 @@ -16,15 +16,15 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -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.SourceSearchController +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchPresenter import eu.kanade.tachiyomi.ui.main.BottomNavBarInterface import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController import uy.kohesive.injekt.injectLazy class SearchController( private var manga: Manga? = null -) : CatalogueSearchController(manga?.title), BottomNavBarInterface { +) : SourceSearchController(manga?.title), BottomNavBarInterface { private var newManga: Manga? = null private var progress = 1 @@ -44,7 +44,7 @@ class SearchController( return super.getTitle() } - override fun createPresenter(): CatalogueSearchPresenter { + override fun createPresenter(): SourceSearchPresenter { 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 78177dd944..df79579c7d 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 @@ -2,14 +2,14 @@ package eu.kanade.tachiyomi.ui.migration import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.source.CatalogueSource -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.SourceSearchCardItem +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchItem +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchPresenter class SearchPresenter( initialQuery: String? = "", private val manga: Manga -) : CatalogueSearchPresenter(initialQuery) { +) : SourceSearchPresenter(initialQuery) { override fun getEnabledSources(): List { // Put the source of the selected manga at the top @@ -17,8 +17,8 @@ class SearchPresenter( .sortedByDescending { it.id == manga.source } } - override fun createCatalogueSearchItem(source: CatalogueSource, results: List?): CatalogueSearchItem { + override fun createCatalogueSearchItem(source: CatalogueSource, results: List?): SourceSearchItem { // 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 SourceSearchItem(source, results, source.id == manga.source) } } 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 9d3131e02f..7efcf2e1ee 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.* +import kotlinx.android.synthetic.main.source_header_item.* /** * 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_header_item } /** 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 2bd2bc7b7d..995739c2e9 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 @@ -6,9 +6,9 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder 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.edit_button -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.title +import kotlinx.android.synthetic.main.source_item.card +import kotlinx.android.synthetic.main.source_item.edit_button +import kotlinx.android.synthetic.main.source_item.title import kotlinx.android.synthetic.main.migration_card_item.* class SourceHolder(view: View, override val adapter: SourceAdapter) : diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt index 02aadc0b49..21b9a95923 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/PreMigrationController.kt @@ -145,7 +145,7 @@ class PreMigrationController(bundle: Bundle? = null) : BaseController(bundle), F fun isEnabled(id: String): Boolean { val sourcesSaved = prefs.migrationSources().getOrDefault() - val hiddenCatalogues = prefs.hiddenCatalogues().getOrDefault() + val hiddenCatalogues = prefs.hiddenSources().getOrDefault() return if (sourcesSaved.isEmpty()) id !in hiddenCatalogues else sourcesSaved.split("/").contains(id) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt index 31d6bffac6..888b30e4b5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt @@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.util.view.invisible import eu.kanade.tachiyomi.util.view.setVectorCompat import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.catalogue_grid_item.view.* +import kotlinx.android.synthetic.main.manga_grid_item.view.* import kotlinx.android.synthetic.main.migration_process_item.* import kotlinx.android.synthetic.main.unread_download_badge.view.* import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt index 9d4358d9d7..a64ca1d484 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt @@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.data.database.models.History import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.ui.base.controller.BaseController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.browse.ProgressItem +import eu.kanade.tachiyomi.ui.source.browse.ProgressItem import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.util.system.launchUI diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt index 8be5f447fd..5fbf31e480 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsSourcesController.kt @@ -85,7 +85,7 @@ class SettingsSourcesController : SettingsController() { * @param group the language category. */ private fun addLanguageSources(group: PreferenceGroup, sources: List) { - val hiddenCatalogues = preferences.hiddenCatalogues().getOrDefault() + val hiddenCatalogues = preferences.hiddenSources().getOrDefault() val selectAllPreference = CheckBoxPreference(group.context).apply { @@ -97,12 +97,12 @@ class SettingsSourcesController : SettingsController() { onChange { newValue -> val checked = newValue as Boolean - val current = preferences.hiddenCatalogues().get() ?: mutableSetOf() + val current = preferences.hiddenSources().get() ?: mutableSetOf() if (checked) current.removeAll(sources.map { it.id.toString() }) else current.addAll(sources.map { it.id.toString() }) - preferences.hiddenCatalogues().set(current) + preferences.hiddenSources().set(current) group.removeAll() addLanguageSources(group, sortedSources(sources)) true @@ -126,9 +126,9 @@ class SettingsSourcesController : SettingsController() { onChange { newValue -> val checked = newValue as Boolean - val current = preferences.hiddenCatalogues().getOrDefault() + val current = preferences.hiddenSources().getOrDefault() - preferences.hiddenCatalogues().set( + preferences.hiddenSources().set( if (checked) current - id else current + id ) @@ -220,7 +220,7 @@ class SettingsSourcesController : SettingsController() { private fun sortedSources(sources: List?): List { val sourceAlpha = sources.orEmpty().sortedBy { it.name } return if (sorting == SourcesSort.Enabled) { - val hiddenCatalogues = preferences.hiddenCatalogues().getOrDefault() + val hiddenCatalogues = preferences.hiddenSources().getOrDefault() sourceAlpha.filter { it.id.toString() !in hiddenCatalogues } + sourceAlpha.filterNot { it.id.toString() !in hiddenCatalogues } } else { 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 83% 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 92ac8926ab..485993fcc5 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,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue +package eu.kanade.tachiyomi.ui.source import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -6,7 +6,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.system.LocaleHelper -import kotlinx.android.synthetic.main.catalogue_main_controller_card.* +import kotlinx.android.synthetic.main.source_header_item.* 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 8e3167f358..0a692f3ed4 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_header_item } /** 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 ca78228789..f6323daf22 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.background_card) @@ -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 89% 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 b57fb25674..1e5e4e5abe 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.app.Activity @@ -27,38 +27,38 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.ui.base.controller.NucleusController 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.extension.SettingsExtensionsController import eu.kanade.tachiyomi.ui.main.BottomSheetController import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.RootSearchInterface import eu.kanade.tachiyomi.ui.setting.SettingsSourcesController +import eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController +import eu.kanade.tachiyomi.ui.source.global_search.SourceSearchController +import eu.kanade.tachiyomi.ui.source.latest.LatestUpdatesController import eu.kanade.tachiyomi.util.view.applyWindowInsetsForRootController import eu.kanade.tachiyomi.util.view.scrollViewWith import eu.kanade.tachiyomi.util.view.setOnQueryTextChangeListener import kotlinx.android.parcel.Parcelize -import kotlinx.android.synthetic.main.catalogue_main_controller.* import kotlinx.android.synthetic.main.extensions_bottom_sheet.* import kotlinx.android.synthetic.main.main_activity.* +import kotlinx.android.synthetic.main.source_controller.* import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import kotlin.math.max /** * 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(), FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, - CatalogueAdapter.OnBrowseClickListener, + SourceAdapter.OnBrowseClickListener, RootSearchInterface, BottomSheetController, - CatalogueAdapter.OnLatestClickListener { + SourceAdapter.OnLatestClickListener { /** * Application preferences. @@ -68,7 +68,7 @@ class CatalogueController : NucleusController(), /** * Adapter containing sources. */ - private var adapter: CatalogueAdapter? = null + private var adapter: SourceAdapter? = null var extQuery = "" private set @@ -90,26 +90,26 @@ class CatalogueController : NucleusController(), else applicationContext?.getString(R.string.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_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 { - return inflater.inflate(R.layout.catalogue_main_controller, container, false) + return inflater.inflate(R.layout.source_controller, container, false) } override fun onViewCreated(view: View) { super.onViewCreated(view) view.applyWindowInsetsForRootController(activity!!.bottom_nav) - adapter = CatalogueAdapter(this) + adapter = SourceAdapter(this) // Create recycler and set adapter. recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) @@ -212,14 +212,14 @@ class CatalogueController : NucleusController(), val item = adapter?.getItem(position) as? SourceItem ?: return false val source = item.source // Open the catalogue view. - openCatalogue(source, BrowseCatalogueController(source)) + openCatalogue(source, BrowseSourceController(source)) return false } override fun onItemLongClick(position: Int) { 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(activity) .title(text = item.source.name) @@ -235,8 +235,8 @@ class CatalogueController : NucleusController(), } private fun hideCatalogue(source: Source) { - val current = preferences.hiddenCatalogues().getOrDefault() - preferences.hiddenCatalogues().set(current + source.id.toString()) + val current = preferences.hiddenSources().getOrDefault() + preferences.hiddenSources().set(current + source.id.toString()) presenter.updateSources() } @@ -253,14 +253,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 @@ -270,7 +270,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()) } @@ -326,7 +326,7 @@ class CatalogueController : NucleusController(), } private fun performGlobalSearch(query: String) { - router.pushController(CatalogueSearchController(query).withFadeTransaction()) + router.pushController(SourceSearchController(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 403debef83..b54a64bc8c 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 86% 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 54af3f6f92..eba14af225 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.source.icon @@ -6,9 +6,9 @@ import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.roundTextIcon import eu.kanade.tachiyomi.util.view.visible -import kotlinx.android.synthetic.main.catalogue_main_controller_card_item.* +import kotlinx.android.synthetic.main.source_item.* -class SourceHolder(view: View, val adapter: CatalogueAdapter) : +class SourceHolder(view: View, val adapter: SourceAdapter) : BaseFlexibleViewHolder(view, adapter) { /*override val slice = Slice(card).apply { 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 6bd24406e7..5f8b24eb31 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_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 90% 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 3bef061a74..e53190b82f 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 java.util.TreeMap import java.util.concurrent.TimeUnit /** - * 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() { @@ -103,7 +103,7 @@ class CataloguePresenter( */ private fun getEnabledSources(): List { val languages = preferences.enabledLanguages().getOrDefault() - val hiddenCatalogues = preferences.hiddenCatalogues().getOrDefault() + val hiddenCatalogues = preferences.hiddenSources().getOrDefault() return sourceManager.getCatalogueSources() .filter { it.lang in languages } 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 91% 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 e33cf9cb3d..951c027a2d 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.os.Bundle import android.view.LayoutInflater @@ -27,10 +27,10 @@ import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.catalogue.CatalogueController import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaDetailsController +import eu.kanade.tachiyomi.ui.source.SourceController import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.util.system.connectivityManager import eu.kanade.tachiyomi.util.system.dpToPx @@ -42,7 +42,7 @@ import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.util.view.visibleIf import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.catalogue_controller.* +import kotlinx.android.synthetic.main.browse_source_controller.* import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers @@ -53,8 +53,8 @@ import java.util.concurrent.TimeUnit /** * 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, @@ -63,7 +63,7 @@ open class BrowseCatalogueController(bundle: Bundle) : constructor( source: CatalogueSource, searchQuery: String? = null, - smartSearchConfig: CatalogueController.SmartSearchConfig? = null + smartSearchConfig: SourceController.SmartSearchConfig? = null ) : this(Bundle().apply { putLong(SOURCE_ID_KEY, source.id) @@ -93,11 +93,6 @@ open class BrowseCatalogueController(bundle: Bundle) : */ private var snack: Snackbar? = null - /** - * Navigation view containing filter items. - */ - private var navView: CatalogueNavigationView? = null - /** * Recycler view with the list of results. */ @@ -121,12 +116,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 { - return inflater.inflate(R.layout.catalogue_controller, container, false) + return inflater.inflate(R.layout.browse_source_controller, container, false) } override fun onViewCreated(view: View) { @@ -136,8 +131,6 @@ open class BrowseCatalogueController(bundle: Bundle) : adapter = FlexibleAdapter(null, this) setupRecycler(view) - navView?.setFilters(presenter.filterItems) - fab.visibleIf(presenter.sourceFilters.isNotEmpty()) fab.setOnClickListener { showFilters() } progress?.visible() @@ -170,7 +163,7 @@ open class BrowseCatalogueController(bundle: Bundle) : addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) } } else { - (catalogue_view.inflate(R.layout.catalogue_recycler_autofit) as AutofitRecyclerView).apply { + (catalogue_view.inflate(R.layout.manga_recycler_autofit) as AutofitRecyclerView).apply { columnWidth = when (preferences.gridSize().getOrDefault()) { 0 -> 1f 2 -> 1.66f @@ -180,7 +173,7 @@ open class BrowseCatalogueController(bundle: Bundle) : (layoutManager as androidx.recyclerview.widget.GridLayoutManager).spanSizeLookup = object : androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup() { override fun getSpanSize(position: Int): Int { return when (adapter?.getItemViewType(position)) { - R.layout.catalogue_grid_item, null -> 1 + R.layout.manga_grid_item, null -> 1 else -> spanCount } } @@ -229,7 +222,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 } @@ -278,7 +271,7 @@ open class BrowseCatalogueController(bundle: Bundle) : } private fun showFilters() { - val sheet = CatalogueSearchSheet(activity!!) + val sheet = SourceSearchSheet(activity!!) sheet.setFilters(presenter.filterItems) presenter.filtersChanged = false val oldFilters = mutableListOf() @@ -358,7 +351,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) { @@ -381,7 +374,7 @@ open class BrowseCatalogueController(bundle: Bundle) : snack?.dismiss() val message = if (error is NoResultsException) catalogue_view.context.getString(R.string.no_results_found) else (error.message ?: "") - snack = catalouge_layout?.snack(message, Snackbar.LENGTH_INDEFINITE) { + snack = source_layout?.snack(message, Snackbar.LENGTH_INDEFINITE) { setAction(R.string.retry) { // If not the first page, show bottom progress bar. if (adapter.mainItemCount > 0) { @@ -442,7 +435,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? BrowseSourceItem)?.manga } presenter.initializeMangas(mangas) } @@ -454,13 +447,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): BrowseSourceHolder? { val adapter = adapter ?: return null adapter.allBoundViewHolders.forEach { holder -> - val item = adapter.getItem(holder.adapterPosition) as? CatalogueItem + val item = adapter.getItem(holder.adapterPosition) as? BrowseSourceItem if (item != null && item.manga.id!! == manga.id!!) { - return holder as CatalogueHolder + return holder as BrowseSourceHolder } } @@ -490,7 +483,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? BrowseSourceItem ?: return false router.pushController(MangaDetailsController(item.manga, true).withFadeTransaction()) return false @@ -506,12 +499,12 @@ open class BrowseCatalogueController(bundle: Bundle) : * @param position the position of the element clicked. */ override fun onItemLongClick(position: Int) { - val manga = (adapter?.getItem(position) as? CatalogueItem?)?.manga ?: return + val manga = (adapter?.getItem(position) as? BrowseSourceItem?)?.manga ?: return snack?.dismiss() if (manga.favorite) { presenter.changeMangaFavorite(manga) adapter?.notifyItemChanged(position) - snack = catalouge_layout?.snack(R.string.removed_from_library, Snackbar.LENGTH_INDEFINITE) { + snack = source_layout?.snack(R.string.removed_from_library, Snackbar.LENGTH_INDEFINITE) { setAction(R.string.undo) { if (!manga.favorite) addManga(manga, position) } @@ -525,7 +518,7 @@ open class BrowseCatalogueController(bundle: Bundle) : (activity as? MainActivity)?.setUndoSnackBar(snack) } else { addManga(manga, position) - snack = catalouge_layout?.snack(R.string.added_to_library) + snack = source_layout?.snack(R.string.added_to_library) } } 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/BrowseSourceGridHolder.kt similarity index 93% 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/BrowseSourceGridHolder.kt index 3853bc8edf..06f71e6136 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/BrowseSourceGridHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.ui.library.LibraryCategoryAdapter import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.catalogue_grid_item.* +import kotlinx.android.synthetic.main.manga_grid_item.* import kotlinx.android.synthetic.main.unread_download_badge.* /** @@ -24,11 +24,11 @@ import kotlinx.android.synthetic.main.unread_download_badge.* * @param listener a listener to react to single tap and long tap events. * @constructor creates a new library holder. */ -class CatalogueGridHolder( +class BrowseSourceGridHolder( private val view: View, private val adapter: FlexibleAdapter>, compact: Boolean -) : CatalogueHolder(view, adapter) { +) : BrowseSourceHolder(view, adapter) { init { if (compact) { 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/BrowseSourceHolder.kt similarity index 86% 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/BrowseSourceHolder.kt index 722c731668..b3bf5301e4 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/BrowseSourceHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -13,7 +13,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 BrowseSourceHolder(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/BrowseSourceItem.kt similarity index 86% 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/BrowseSourceItem.kt index 23a9c1bf2f..49fb739372 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/BrowseSourceItem.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 @@ -18,23 +18,23 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.widget.AutofitRecyclerView -import kotlinx.android.synthetic.main.catalogue_grid_item.view.* +import kotlinx.android.synthetic.main.manga_grid_item.view.* -class CatalogueItem( +class BrowseSourceItem( val manga: Manga, private val catalogueAsList: Preference, private val catalogueListType: Preference ) : - AbstractFlexibleItem() { + AbstractFlexibleItem() { override fun getLayoutRes(): Int { return if (catalogueAsList.getOrDefault()) - R.layout.catalogue_list_item + R.layout.manga_list_item else - R.layout.catalogue_grid_item + R.layout.manga_grid_item } - override fun createViewHolder(view: View, adapter: FlexibleAdapter>): CatalogueHolder { + override fun createViewHolder(view: View, adapter: FlexibleAdapter>): BrowseSourceHolder { val parent = adapter.recyclerView return if (parent is AutofitRecyclerView) { val listType = catalogueListType.getOrDefault() @@ -66,15 +66,15 @@ class CatalogueItem( (parent.itemWidth / 3f * 3.7f).toInt() ) } - CatalogueGridHolder(view, adapter, listType == 1) + BrowseSourceGridHolder(view, adapter, listType == 1) } else { - CatalogueListHolder(view, adapter) + BrowseSourceListHolder(view, adapter) } } override fun bindViewHolder( adapter: FlexibleAdapter>, - holder: CatalogueHolder, + holder: BrowseSourceHolder, position: Int, payloads: MutableList? ) { @@ -84,7 +84,7 @@ class CatalogueItem( override fun equals(other: Any?): Boolean { if (this === other) return true - if (other is CatalogueItem) { + if (other is BrowseSourceItem) { return manga.id!! == other.manga.id!! } return false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt similarity index 88% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt index d53ad5b222..5fcb45c843 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.view.View import androidx.recyclerview.widget.RecyclerView @@ -11,7 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.widget.StateImageViewTarget -import kotlinx.android.synthetic.main.catalogue_list_item.* +import kotlinx.android.synthetic.main.manga_list_item.* /** * Class used to hold the displayed data of a manga in the catalogue, like the cover or the title. @@ -21,8 +21,8 @@ import kotlinx.android.synthetic.main.catalogue_list_item.* * @param adapter the adapter handling this holder. * @constructor creates a new catalogue holder. */ -class CatalogueListHolder(private val view: View, adapter: FlexibleAdapter>) : - CatalogueHolder(view, adapter) { +class BrowseSourceListHolder(private val view: View, adapter: FlexibleAdapter>) : + BrowseSourceHolder(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/CataloguePager.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePager.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/BrowseSourcePager.kt index 08dad01c28..5efdf10642 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/BrowseSourcePager.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 BrowseSourcePager(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/browse/BrowseCataloguePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourcePresenter.kt similarity index 89% 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 3cc8fee9d3..ce2d06009f 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 @@ -16,19 +16,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 @@ -40,15 +40,15 @@ import uy.kohesive.injekt.api.get import java.util.Date /** - * 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. @@ -120,7 +120,7 @@ open class BrowseCataloguePresenter( query = savedState.getString(::query.name, "") } - add(prefs.catalogueAsList().asObservable() + add(prefs.browseAsList().asObservable() .subscribe { setDisplayMode(it) }) restartPager() @@ -148,8 +148,8 @@ open class BrowseCataloguePresenter( val sourceId = source.id - val catalogueAsList = prefs.catalogueAsList() - val catalougeListType = prefs.libraryLayout() + val browseAsList = prefs.browseAsList() + val sourceListType = prefs.libraryLayout() // Prepare the pager. pagerSubscription?.let { remove(it) } @@ -157,7 +157,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, catalougeListType) } } + .map { it.first to it.second.map { BrowseSourceItem(it, browseAsList, sourceListType) } } .observeOn(AndroidSchedulers.mainThread()) .subscribeReplay({ view, (page, mangas) -> view.onAddPage(page, mangas) @@ -179,7 +179,7 @@ open class BrowseCataloguePresenter( pageSubscription = Observable.defer { pager.requestNext() } .subscribeFirst({ _, _ -> // Nothing to do when onNext is emitted. - }, BrowseCatalogueController::onAddPageError) + }, BrowseSourceController::onAddPageError) } /** @@ -294,7 +294,7 @@ open class BrowseCataloguePresenter( * Changes the active display mode. */ fun swapDisplayMode() { - prefs.catalogueAsList().set(!isListMode) + prefs.browseAsList().set(!isListMode) } /** @@ -307,7 +307,7 @@ open class BrowseCataloguePresenter( } open fun createPager(query: String, filters: FilterList): Pager { - return CataloguePager(source, query, filters) + return BrowseSourcePager(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 0000000000..744718def9 --- /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 62b88aa855..378839f7af 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 398df17b73..6849c9b5ae 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 @@ -15,7 +15,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/CatalogueSearchSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceSearchSheet.kt similarity index 93% rename from app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueSearchSheet.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceSearchSheet.kt index b1446f6d4d..963c9e31f9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/CatalogueSearchSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/SourceSearchSheet.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.ui.catalogue.browse +package eu.kanade.tachiyomi.ui.source.browse import android.animation.ObjectAnimator import android.animation.ValueAnimator @@ -16,10 +16,10 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.view.setEdgeToEdge -import kotlinx.android.synthetic.main.catalogue_filter_sheet.* +import kotlinx.android.synthetic.main.source_filter_sheet.* import uy.kohesive.injekt.injectLazy -class CatalogueSearchSheet(activity: Activity) : +class SourceSearchSheet(activity: Activity) : BottomSheetDialog(activity, R.style.BottomSheetDialogTheme) { /** @@ -43,7 +43,7 @@ class CatalogueSearchSheet(activity: Activity) : var onResetClicked = {} init { - val view = activity.layoutInflater.inflate(R.layout.catalogue_filter_sheet, null) + val view = activity.layoutInflater.inflate(R.layout.source_filter_sheet, null) setContentView(view) toolbar_title.text = context.getString(R.string.search_filters) search_btn.setOnClickListener { dismiss() } 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 87be5a3d98..601d93b64b 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 d252cb3f03..d3f14249d8 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 97% 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 6d5cf8b340..c2f9fa08a6 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 27e1efa5e6..5ce745e037 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 1182b86db3..10825e75fa 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 5de9d4176d..26983cae0b 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 1e65a3fd26..1007f5516e 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 8d73db6bb8..ba4cbd2af4 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 0bb23c7c97..1dfba705cf 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 dbb65ffb08..8a6bee16a2 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/SourceSearchAdapter.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/SourceSearchAdapter.kt index 0b058d1f4f..7499a76f6b 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/SourceSearchAdapter.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 @@ -8,10 +8,10 @@ import eu.davidea.flexibleadapter.FlexibleAdapter /** * Adapter that holds the search cards. * - * @param controller instance of [CatalogueSearchController]. + * @param controller instance of [SourceSearchController]. */ -class CatalogueSearchAdapter(val controller: CatalogueSearchController) : - FlexibleAdapter(null, controller, true) { +class SourceSearchAdapter(val controller: SourceSearchController) : + 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/SourceSearchCardAdapter.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/SourceSearchCardAdapter.kt index 6ed9180794..3bf479c49b 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/SourceSearchCardAdapter.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 [SourceSearchController]. */ -class CatalogueSearchCardAdapter(controller: CatalogueSearchController) : - FlexibleAdapter(null, controller, true) { +class SourceSearchCardAdapter(controller: SourceSearchController) : + 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 [SourceSearchController] */ 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/SourceSearchCardHolder.kt similarity index 87% 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/SourceSearchCardHolder.kt index 52cb76a5e4..7cf6da853d 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/SourceSearchCardHolder.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,9 +6,9 @@ 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.* +import kotlinx.android.synthetic.main.source_global_search_controller_card_item.* -class CatalogueSearchCardHolder(view: View, adapter: CatalogueSearchCardAdapter) : +class SourceSearchCardHolder(view: View, adapter: SourceSearchCardAdapter) : 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/SourceSearchCardItem.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/SourceSearchCardItem.kt index 444c668647..6669e84cf6 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/SourceSearchCardItem.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 SourceSearchCardItem(val manga: Manga) : AbstractFlexibleItem() { override fun getLayoutRes(): Int { - return R.layout.catalogue_global_search_controller_card_item + return R.layout.source_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>): SourceSearchCardHolder { + return SourceSearchCardHolder(view, adapter as SourceSearchCardAdapter) } override fun bindViewHolder( adapter: FlexibleAdapter>, - holder: CatalogueSearchCardHolder, + holder: SourceSearchCardHolder, position: Int, payloads: MutableList? ) { @@ -28,7 +28,7 @@ class CatalogueSearchCardItem(val manga: Manga) : AbstractFlexibleItem(), - CatalogueSearchCardAdapter.OnMangaClickListener { +) : NucleusController(), + SourceSearchCardAdapter.OnMangaClickListener { /** * Adapter containing search results grouped by lang. */ - protected var adapter: CatalogueSearchAdapter? = null + protected var adapter: SourceSearchAdapter? = null private var customTitle: String? = null @@ -45,14 +45,14 @@ open class CatalogueSearchController( } /** - * Initiate the view with [R.layout.catalogue_global_search_controller]. + * Initiate the view with [R.layout.source_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): android.view.View { - return inflater.inflate(R.layout.catalogue_global_search_controller, container, false) + return inflater.inflate(R.layout.source_global_search_controller, container, false) } /** @@ -65,12 +65,12 @@ open class CatalogueSearchController( } /** - * Create the [CatalogueSearchPresenter] used in controller. + * Create the [SourceSearchPresenter] used in controller. * - * @return instance of [CatalogueSearchPresenter] + * @return instance of [SourceSearchPresenter] */ - override fun createPresenter(): CatalogueSearchPresenter { - return CatalogueSearchPresenter(initialQuery, extensionFilter) + override fun createPresenter(): SourceSearchPresenter { + return SourceSearchPresenter(initialQuery, extensionFilter) } /** @@ -138,7 +138,7 @@ open class CatalogueSearchController( super.onViewCreated(view) view.applyWindowInsetsForController() - adapter = CatalogueSearchAdapter(this) + adapter = SourceSearchAdapter(this) // Create recycler and set adapter. recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) @@ -171,13 +171,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): SourceSearchHolder? { 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 SourceSearchHolder } } @@ -189,7 +189,7 @@ open class CatalogueSearchController( * * @param searchResult result of search. */ - fun setItems(searchResult: List) { + fun setItems(searchResult: List) { if (extensionFilter != null) { val results = searchResult.first().results if (results != null && results.size == 1) { 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/SourceSearchHolder.kt similarity index 75% 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/SourceSearchHolder.kt index ce878490bf..ca8c4b1e8c 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/SourceSearchHolder.kt @@ -1,28 +1,27 @@ -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 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.* +import kotlinx.android.synthetic.main.source_global_search_controller_card.* /** - * Holder that binds the [CatalogueSearchItem] containing catalogue cards. + * Holder that binds the [SourceSearchItem] containing catalogue cards. * - * @param view view of [CatalogueSearchItem] - * @param adapter instance of [CatalogueSearchAdapter] + * @param view view of [SourceSearchItem] + * @param adapter instance of [SourceSearchAdapter] */ -class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : +class SourceSearchHolder(view: View, val adapter: SourceSearchAdapter) : BaseFlexibleViewHolder(view, adapter) { /** * Adapter containing manga from search results. */ - private val mangaAdapter = CatalogueSearchCardAdapter(adapter.controller) + private val mangaAdapter = SourceSearchCardAdapter(adapter.controller) - private var lastBoundResults: List? = null + private var lastBoundResults: List? = null init { // Set layout horizontal. @@ -36,7 +35,7 @@ class CatalogueSearchHolder(view: View, val adapter: CatalogueSearchAdapter) : * * @param item item of card. */ - fun bind(item: CatalogueSearchItem) { + fun bind(item: SourceSearchItem) { val source = item.source val results = item.results @@ -81,11 +80,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): SourceSearchCardHolder? { 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 SourceSearchCardHolder } } 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/SourceSearchItem.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/SourceSearchItem.kt index c8408f2109..60ef00d2f0 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/SourceSearchItem.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 SourceSearchItem(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>): SourceSearchHolder { + return SourceSearchHolder(view, adapter as SourceSearchAdapter) } /** @@ -41,7 +41,7 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List>, - holder: CatalogueSearchHolder, + holder: SourceSearchHolder, position: Int, payloads: MutableList? ) { @@ -54,7 +54,7 @@ class CatalogueSearchItem(val source: CatalogueSource, val results: List() { + private val preferencesHelper: PreferencesHelper = Injekt.get() +) : BasePresenter() { /** * Enabled sources. @@ -73,12 +73,12 @@ open class CatalogueSearchPresenter( override fun onCreate(savedState: Bundle?) { super.onCreate(savedState) - extensionFilter = savedState?.getString(CatalogueSearchPresenter::extensionFilter.name) + extensionFilter = savedState?.getString(SourceSearchPresenter::extensionFilter.name) ?: initialExtensionFilter // Perform a search with previous or initial state search( - savedState?.getString(BrowseCataloguePresenter::query.name) ?: initialQuery.orEmpty() + savedState?.getString(BrowseSourcePresenter::query.name) ?: initialQuery.orEmpty() ) } @@ -89,8 +89,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(SourceSearchPresenter::extensionFilter.name, extensionFilter) super.onSave(state) } @@ -101,7 +101,7 @@ open class CatalogueSearchPresenter( */ protected open fun getEnabledSources(): List { val languages = preferencesHelper.enabledLanguages().getOrDefault() - val hiddenCatalogues = preferencesHelper.hiddenCatalogues().getOrDefault() + val hiddenCatalogues = preferencesHelper.hiddenSources().getOrDefault() return sourceManager.getCatalogueSources() .filter { it.lang in languages } @@ -132,9 +132,9 @@ open class CatalogueSearchPresenter( */ protected open fun createCatalogueSearchItem( source: CatalogueSource, - results: List? - ): CatalogueSearchItem { - return CatalogueSearchItem(source, results) + results: List? + ): SourceSearchItem { + return SourceSearchItem(source, results) } /** @@ -178,7 +178,7 @@ open class CatalogueSearchPresenter( .map { createCatalogueSearchItem( source, - it.map { CatalogueSearchCardItem(it) }) + it.map { SourceSearchCardItem(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 62% 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 82d1ffd85d..0bf7e46b34 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,19 +1,19 @@ -package eu.kanade.tachiyomi.ui.catalogue.latest +package eu.kanade.tachiyomi.ui.source.latest import android.os.Bundle import android.view.Menu import android.view.View 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 import eu.kanade.tachiyomi.util.view.gone -import kotlinx.android.synthetic.main.catalogue_controller.* +import kotlinx.android.synthetic.main.browse_source_controller.* /** - * 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) @@ -24,7 +24,7 @@ class LatestUpdatesController(bundle: Bundle) : BrowseCatalogueController(bundle fab.gone() } - 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 704b375c00..ff908a40b8 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 9b514528a3..fbbfa0185e 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 b57b432037..3c23230186 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 @@ -57,7 +57,7 @@ object LocaleHelper { return when (lang) { null -> "" "" -> context.getString(R.string.other) - CataloguePresenter.PINNED_KEY -> context.getString(R.string.pinned) + SourcePresenter.PINNED_KEY -> context.getString(R.string.pinned) "all" -> context.getString(R.string.all) else -> { val locale = getLocale(lang) diff --git a/app/src/main/res/layout/catalogue_controller.xml b/app/src/main/res/layout/browse_source_controller.xml similarity index 92% rename from app/src/main/res/layout/catalogue_controller.xml rename to app/src/main/res/layout/browse_source_controller.xml index 76582f5d8e..b68f988a3c 100644 --- a/app/src/main/res/layout/catalogue_controller.xml +++ b/app/src/main/res/layout/browse_source_controller.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:id="@+id/catalouge_layout" + android:id="@+id/source_layout" android:layout_height="match_parent"> + tools:context="eu.kanade.tachiyomi.ui.source.browse.BrowseSourceController"> + tools:listitem="@layout/manga_grid_item" /> diff --git a/app/src/main/res/layout/catalogue_grid_item.xml b/app/src/main/res/layout/manga_grid_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_grid_item.xml rename to app/src/main/res/layout/manga_grid_item.xml diff --git a/app/src/main/res/layout/catalogue_list_item.xml b/app/src/main/res/layout/manga_list_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_list_item.xml rename to app/src/main/res/layout/manga_list_item.xml diff --git a/app/src/main/res/layout/catalogue_recycler_autofit.xml b/app/src/main/res/layout/manga_recycler_autofit.xml similarity index 82% rename from app/src/main/res/layout/catalogue_recycler_autofit.xml rename to app/src/main/res/layout/manga_recycler_autofit.xml index 1af3eb62d5..9a5afbc3c2 100644 --- a/app/src/main/res/layout/catalogue_recycler_autofit.xml +++ b/app/src/main/res/layout/manga_recycler_autofit.xml @@ -8,5 +8,5 @@ android:layout_height="match_parent" android:columnWidth="120dp" android:clipToPadding="false" - tools:listitem="@layout/catalogue_grid_item" + tools:listitem="@layout/manga_grid_item" xmlns:app="http://schemas.android.com/apk/res-auto" /> \ No newline at end of file diff --git a/app/src/main/res/layout/migration_process_item.xml b/app/src/main/res/layout/migration_process_item.xml index ed3c00910e..7916f00964 100644 --- a/app/src/main/res/layout/migration_process_item.xml +++ b/app/src/main/res/layout/migration_process_item.xml @@ -7,7 +7,7 @@ + tools:listitem="@layout/source_header_item" /> diff --git a/app/src/main/res/layout/catalogue_filter_sheet.xml b/app/src/main/res/layout/source_filter_sheet.xml similarity index 100% rename from app/src/main/res/layout/catalogue_filter_sheet.xml rename to app/src/main/res/layout/source_filter_sheet.xml diff --git a/app/src/main/res/layout/catalogue_global_search_controller.xml b/app/src/main/res/layout/source_global_search_controller.xml similarity index 88% rename from app/src/main/res/layout/catalogue_global_search_controller.xml rename to app/src/main/res/layout/source_global_search_controller.xml index 3a56066ab4..ed738ba4e9 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller.xml +++ b/app/src/main/res/layout/source_global_search_controller.xml @@ -12,6 +12,6 @@ android:clipToPadding="false" android:paddingTop="4dp" android:paddingBottom="4dp" - tools:listitem="@layout/catalogue_global_search_controller_card" /> + tools:listitem="@layout/source_global_search_controller_card" /> diff --git a/app/src/main/res/layout/catalogue_global_search_controller_card.xml b/app/src/main/res/layout/source_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/source_global_search_controller_card.xml index 330baa5af1..b7ac54c74c 100644 --- a/app/src/main/res/layout/catalogue_global_search_controller_card.xml +++ b/app/src/main/res/layout/source_global_search_controller_card.xml @@ -44,7 +44,7 @@ android:paddingEnd="4dp" android:paddingStart="4dp" android:clipToPadding="false" - tools:listitem="@layout/catalogue_global_search_controller_card_item" /> + tools:listitem="@layout/source_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/source_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/source_global_search_controller_card_item.xml diff --git a/app/src/main/res/layout/catalogue_main_controller_card.xml b/app/src/main/res/layout/source_header_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_main_controller_card.xml rename to app/src/main/res/layout/source_header_item.xml diff --git a/app/src/main/res/layout/catalogue_main_controller_card_item.xml b/app/src/main/res/layout/source_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_main_controller_card_item.xml rename to app/src/main/res/layout/source_item.xml diff --git a/app/src/main/res/layout/catalogue_progress_item.xml b/app/src/main/res/layout/source_progress_item.xml similarity index 100% rename from app/src/main/res/layout/catalogue_progress_item.xml rename to app/src/main/res/layout/source_progress_item.xml