From 87ed315ad50f90e4bd1a15943fe8c9a553c16d0c Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 4 Mar 2020 23:01:39 -0800 Subject: [PATCH] Fixed name of manga details controller --- .../browse/BrowseCatalogueController.kt | 5 ++--- .../global_search/CatalogueSearchController.kt | 6 +++--- .../tachiyomi/ui/library/LibraryController.kt | 4 ++-- .../eu/kanade/tachiyomi/ui/main/MainActivity.kt | 4 ++-- .../ui/manga/ChaptersSortBottomSheet.kt | 2 +- .../tachiyomi/ui/manga/ChooseShapeDialog.kt | 4 ++-- ...rsController.kt => MangaDetailsController.kt} | 16 ++++++++-------- ...angaPresenter.kt => MangaDetailsPresenter.kt} | 6 +++--- .../ui/manga/chapter/ChaptersAdapter.kt | 4 ++-- .../tachiyomi/ui/manga/info/EditMangaDialog.kt | 6 +++--- .../manga/process/MigrationProcessHolder.kt | 6 +++--- .../recent_updates/RecentChaptersController.kt | 4 ++-- .../ui/recently_read/RecentlyReadController.kt | 4 ++-- ...ntroller.xml => manga_details_controller.xml} | 0 14 files changed, 35 insertions(+), 36 deletions(-) rename app/src/main/java/eu/kanade/tachiyomi/ui/manga/{MangaChaptersController.kt => MangaDetailsController.kt} (98%) rename app/src/main/java/eu/kanade/tachiyomi/ui/manga/{MangaPresenter.kt => MangaDetailsPresenter.kt} (99%) rename app/src/main/res/layout/{big_manga_controller.xml => manga_details_controller.xml} (100%) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt index 1ab24bc731..be07f1a6c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt @@ -32,8 +32,7 @@ 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.MangaChaptersController -import eu.kanade.tachiyomi.ui.manga.MangaController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.util.system.connectivityManager import eu.kanade.tachiyomi.util.view.HeightTopWindowInsetsListener @@ -501,7 +500,7 @@ open class BrowseCatalogueController(bundle: Bundle) : */ override fun onItemClick(view: View?, position: Int): Boolean { val item = adapter?.getItem(position) as? CatalogueItem ?: return false - router.pushController(MangaChaptersController(item.manga, true).withFadeTransaction()) + router.pushController(MangaDetailsController(item.manga, true).withFadeTransaction()) return false } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt index 53f0f0597e..5e5b67b151 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/global_search/CatalogueSearchController.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import eu.kanade.tachiyomi.util.view.applyWindowInsetsForController import kotlinx.android.synthetic.main.catalogue_global_search_controller.* @@ -80,7 +80,7 @@ open class CatalogueSearchController( */ override fun onMangaClick(manga: Manga) { // Open MangaController. - router.pushController(MangaChaptersController(manga, true).withFadeTransaction()) + router.pushController(MangaDetailsController(manga, true).withFadeTransaction()) } /** @@ -195,7 +195,7 @@ open class CatalogueSearchController( val results = searchResult.first().results if (results != null && results.size == 1) { val manga = results.first().manga - router.replaceTopController(MangaChaptersController(manga, true) + router.replaceTopController(MangaDetailsController(manga, true) .withFadeTransaction() ) return diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index b8a15061f6..f0b4489018 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -43,7 +43,7 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.download.DownloadController import eu.kanade.tachiyomi.ui.library.filter.SortFilterBottomSheet import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.migration.MigrationInterface import eu.kanade.tachiyomi.ui.migration.manga.design.PreMigrationController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController @@ -655,7 +655,7 @@ open class LibraryController( } fun openManga(manga: Manga, startY: Float?) { - router.pushController(MangaChaptersController(manga).withFadeTransaction()) + router.pushController(MangaDetailsController(manga).withFadeTransaction()) // router.pushController(MangaController(manga, startY).withFadeTransaction()) } 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 fe8b475b22..11d9b83b59 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 @@ -50,7 +50,7 @@ import eu.kanade.tachiyomi.ui.download.DownloadController import eu.kanade.tachiyomi.ui.extension.ExtensionController import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.library.LibraryListController -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController import eu.kanade.tachiyomi.ui.recently_read.RecentlyReadController import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate @@ -452,7 +452,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { if (router.backstack.isEmpty()) { navigationView.selectedItemId = R.id.nav_library } - router.pushController(MangaChaptersController(extras).withFadeTransaction()) + router.pushController(MangaDetailsController(extras).withFadeTransaction()) } SHORTCUT_DOWNLOADS -> { if (router.backstack.none { it.controller() is DownloadController }) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChaptersSortBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChaptersSortBottomSheet.kt index dd6d05fc0a..106f60b8f7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChaptersSortBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChaptersSortBottomSheet.kt @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.util.view.setEdgeToEdge import eu.kanade.tachiyomi.util.view.visibleIf import kotlinx.android.synthetic.main.chapter_sort_bottom_sheet.* -class ChaptersSortBottomSheet(controller: MangaChaptersController) : BottomSheetDialog +class ChaptersSortBottomSheet(controller: MangaDetailsController) : BottomSheetDialog (controller.activity!!, R.style.BottomSheetDialogTheme) { val activity = controller.activity!! diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChooseShapeDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChooseShapeDialog.kt index 3492d61fda..866b0df394 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChooseShapeDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/ChooseShapeDialog.kt @@ -17,7 +17,7 @@ class ChooseShapeDialog(bundle: Bundle? = null) : DialogController(bundle) { targetController = target } - constructor(target: MangaChaptersController) : this() { + constructor(target: MangaDetailsController) : this() { targetController = target } @@ -36,7 +36,7 @@ class ChooseShapeDialog(bundle: Bundle? = null) : DialogController(bundle) { waitForPositiveButton = false) { _, i, _ -> (targetController as? MangaInfoController)?.createShortcutForShape(i) - (targetController as? MangaChaptersController)?.createShortcutForShape(i) + (targetController as? MangaDetailsController)?.createShortcutForShape(i) dismissDialog() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaChaptersController.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index 0fac1e1e16..5604ddf598 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -81,15 +81,15 @@ import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updatePaddingRelative import jp.wasabeef.glide.transformations.CropSquareTransformation import jp.wasabeef.glide.transformations.MaskTransformation -import kotlinx.android.synthetic.main.big_manga_controller.* -import kotlinx.android.synthetic.main.big_manga_controller.swipe_refresh import kotlinx.android.synthetic.main.main_activity.* +import kotlinx.android.synthetic.main.manga_details_controller.* +import kotlinx.android.synthetic.main.manga_details_controller.swipe_refresh import kotlinx.android.synthetic.main.manga_info_controller.* import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.io.File -class MangaChaptersController : BaseController, +class MangaDetailsController : BaseController, FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, ChaptersAdapter.MangaHeaderInterface, @@ -125,7 +125,7 @@ class MangaChaptersController : BaseController, private var manga: Manga? = null private var source: Source? = null var colorAnimator:ValueAnimator? = null - lateinit var presenter:MangaPresenter + lateinit var presenter:MangaDetailsPresenter var coverColor:Int? = null var toolbarIsColored = false private var snack: Snackbar? = null @@ -148,7 +148,7 @@ class MangaChaptersController : BaseController, override fun onViewCreated(view: View) { super.onViewCreated(view) coverColor = null - if (!::presenter.isInitialized) presenter = MangaPresenter(this, manga!!, source!!) + if (!::presenter.isInitialized) presenter = MangaDetailsPresenter(this, manga!!, source!!) // Init RecyclerView and adapter adapter = ChaptersAdapter(this, view.context) @@ -221,7 +221,7 @@ class MangaChaptersController : BaseController, } } - fun setPaletteColor() { + private fun setPaletteColor() { val view = view ?: return GlideApp.with(view.context).load(manga) .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC) @@ -636,7 +636,7 @@ class MangaChaptersController : BaseController, } override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { - return inflater.inflate(R.layout.big_manga_controller, container, false) + return inflater.inflate(R.layout.manga_details_controller, container, false) } override fun coverColor(): Int? = coverColor @@ -771,7 +771,7 @@ class MangaChaptersController : BaseController, (activity as? MainActivity)?.setUndoSnackBar(snack, fab_favorite) } - override fun mangaPresenter(): MangaPresenter = presenter + override fun mangaPresenter(): MangaDetailsPresenter = presenter override fun updateCategoriesForMangas(mangas: List, categories: List) { val manga = mangas.firstOrNull() ?: return diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt similarity index 99% rename from app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt rename to app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt index 2fdc00366d..d9946aea3e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt @@ -41,7 +41,7 @@ import java.io.OutputStream import java.util.Date import kotlin.coroutines.CoroutineContext -class MangaPresenter(private val controller: MangaChaptersController, +class MangaDetailsPresenter(private val controller: MangaDetailsController, val manga: Manga, val source: Source, val preferences: PreferencesHelper = Injekt.get(), @@ -346,7 +346,7 @@ class MangaPresenter(private val controller: MangaChaptersController, } isLoading = false if (chapterError == null) - withContext(Dispatchers.Main) { controller.updateChapters(this@MangaPresenter.chapters) } + withContext(Dispatchers.Main) { controller.updateChapters(this@MangaDetailsPresenter.chapters) } if (mangaError != null) withContext(Dispatchers.Main) { controller.showError(trimException(mangaError!!)) } } @@ -372,7 +372,7 @@ class MangaPresenter(private val controller: MangaChaptersController, syncChaptersWithSource(db, chapters, manga, source) updateChapters() - withContext(Dispatchers.Main) { controller.updateChapters(this@MangaPresenter.chapters) } + withContext(Dispatchers.Main) { controller.updateChapters(this@MangaDetailsPresenter.chapters) } } catch(e: java.lang.Exception) { controller.showError(trimException(e)) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt index 01dd376595..10501eb047 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersAdapter.kt @@ -8,7 +8,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.ui.base.controller.BaseController -import eu.kanade.tachiyomi.ui.manga.MangaPresenter +import eu.kanade.tachiyomi.ui.manga.MangaDetailsPresenter import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.util.system.getResourceColor import uy.kohesive.injekt.injectLazy @@ -59,7 +59,7 @@ class ChaptersAdapter( interface MangaHeaderInterface { fun coverColor(): Int? - fun mangaPresenter(): MangaPresenter + fun mangaPresenter(): MangaDetailsPresenter fun prepareToShareManga() fun readNextChapter() fun downloadChapter(position: Int) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/EditMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/EditMangaDialog.kt index 53af9b7d6b..bd43f6ce0c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/EditMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/EditMangaDialog.kt @@ -17,7 +17,7 @@ import eu.kanade.tachiyomi.data.database.models.MangaImpl import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.ui.base.controller.DialogController -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.util.lang.chop import eu.kanade.tachiyomi.util.system.toast import kotlinx.android.synthetic.main.edit_manga_dialog.view.* @@ -35,9 +35,9 @@ class EditMangaDialog : DialogController { private var customCoverUri:Uri? = null private val infoController - get() = targetController as MangaChaptersController + get() = targetController as MangaDetailsController - constructor(target: MangaChaptersController, manga: Manga) : super(Bundle() + constructor(target: MangaDetailsController, manga: Manga) : super(Bundle() .apply { putLong(KEY_MANGA, manga.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 e3b3913d1f..884fe2cb9d 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 @@ -13,7 +13,7 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.launchUI import eu.kanade.tachiyomi.util.view.gone @@ -69,7 +69,7 @@ class MigrationProcessHolder( migration_manga_card_from.attachManga(manga, source, false) migration_manga_card_from.setOnClickListener { adapter.controller.router.pushController( - MangaChaptersController( + MangaDetailsController( manga, true ).withFadeTransaction() ) @@ -101,7 +101,7 @@ class MigrationProcessHolder( migration_manga_card_to.attachManga(searchResult, resultSource, true) migration_manga_card_to.setOnClickListener { adapter.controller.router.pushController( - MangaChaptersController( + MangaDetailsController( searchResult, true ).withFadeTransaction() ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt index a5e9a5182e..d87a064f7a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt @@ -24,7 +24,7 @@ import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController import eu.kanade.tachiyomi.ui.base.controller.NucleusController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.recently_read.RecentlyReadController import eu.kanade.tachiyomi.util.system.notificationManager @@ -274,7 +274,7 @@ class RecentChaptersController : NucleusController(), } fun openManga(chapter: RecentChapterItem) { - router.pushController(MangaChaptersController(chapter.manga).withFadeTransaction()) + router.pushController(MangaDetailsController(chapter.manga).withFadeTransaction()) } /** 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 27207c8444..e9eba36186 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 @@ -20,7 +20,7 @@ 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.main.MainActivity -import eu.kanade.tachiyomi.ui.manga.MangaChaptersController +import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.recent_updates.RecentChaptersController import eu.kanade.tachiyomi.util.system.launchUI @@ -179,7 +179,7 @@ class RecentlyReadController(bundle: Bundle? = null) : BaseController(bundle), override fun onCoverClick(position: Int, lastTouchY: Float) { val manga = (adapter?.getItem(position) as? RecentlyReadItem)?.mch?.manga ?: return - router.pushController(MangaChaptersController(manga).withFadeTransaction()) + router.pushController(MangaDetailsController(manga).withFadeTransaction()) } override fun removeHistory(manga: Manga, history: History, all: Boolean) { diff --git a/app/src/main/res/layout/big_manga_controller.xml b/app/src/main/res/layout/manga_details_controller.xml similarity index 100% rename from app/src/main/res/layout/big_manga_controller.xml rename to app/src/main/res/layout/manga_details_controller.xml