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 106d18ba09..4b142722e0 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 @@ -17,7 +17,7 @@ class MangaHolder( fun bind(item: MangaItem) { // Update the title of the manga. title.text = item.manga.title - subtitle.text = item.manga.author?.trim() + subtitle.text = "" // Update the cover. cover_thumbnail.clear() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt index ae0728e764..d49a515abf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MigrationController.kt @@ -24,8 +24,7 @@ import uy.kohesive.injekt.api.get class MigrationController : NucleusController(), FlexibleAdapter.OnItemClickListener, - SourceAdapter.OnSelectClickListener, - SourceAdapter.OnAutoClickListener, + SourceAdapter.OnAllClickListener, MigrationInterface { private var adapter: FlexibleAdapter>? = null @@ -115,11 +114,7 @@ class MigrationController : NucleusController(), return false } - override fun onSelectClick(position: Int) { - onItemClick(view, position) - } - - override fun onAutoClick(position: Int) { + override fun onAllClick(position: Int) { val item = adapter?.getItem(position) as? SourceItem ?: return launchUI { 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 7efcf2e1ee..6bf33dfef2 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 @@ -42,7 +42,7 @@ class SelectionHeader : AbstractHeaderItem() { class Holder(view: View, adapter: FlexibleAdapter>) : BaseFlexibleViewHolder(view, adapter) { init { - title.text = view.context.getString(R.string.select_a_source_to_migrate_from) + title.text = view.context.getString(R.string.select_a_source_then_item_to_migrate) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt index 1467a4763b..27d8f512be 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceAdapter.kt @@ -17,28 +17,16 @@ class SourceAdapter(val controller: MigrationController) : setDisplayHeadersAtStartUp(true) } - /** - * Listener for browse item clicks. - */ - val selectClickListener: OnSelectClickListener? = controller - - /** - * Listener which should be called when user clicks select. - */ - interface OnSelectClickListener { - fun onSelectClick(position: Int) - } - /** * Listener for auto item clicks. */ - val autoClickListener: OnAutoClickListener? = controller + val allClickListener: OnAllClickListener? = controller /** * Listener which should be called when user clicks select. */ - interface OnAutoClickListener { - fun onAutoClick(position: Int) + interface OnAllClickListener { + fun onAllClick(position: Int) } override fun updateDataSet(items: MutableList>?) { 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 2ffdee0411..65bfadab94 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 @@ -11,11 +11,8 @@ class SourceHolder(view: View, val adapter: SourceAdapter) : BaseFlexibleViewHolder(view, adapter) { init { - migration_auto.setOnClickListener { - adapter.autoClickListener?.onAutoClick(adapterPosition) - } - migration_select.setOnClickListener { - adapter.selectClickListener?.onSelectClick(adapterPosition) + migration_all.setOnClickListener { + adapter.allClickListener?.onAllClick(adapterPosition) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt index 952493e610..c3ced3d249 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceAdapter.kt @@ -15,34 +15,15 @@ class SourceAdapter(val controller: SourceController) : setDisplayHeadersAtStartUp(true) } - /** - * Listener for browse item clicks. - */ - val browseClickListener: OnBrowseClickListener = controller - - /** - * Listener for latest item clicks. - */ - val latestClickListener: OnLatestClickListener = controller + val sourceListener: SourceListener = controller override fun onItemSwiped(position: Int, direction: Int) { super.onItemSwiped(position, direction) controller.hideCatalogue(position) } - /** - * Listener which should be called when user clicks browse. - * Note: Should only be handled by [SourceController] - */ - interface OnBrowseClickListener { - fun onBrowseClick(position: Int) - } - - /** - * Listener which should be called when user clicks latest. - * Note: Should only be handled by [SourceController] - */ - interface OnLatestClickListener { + interface SourceListener { + fun onPinClick(position: Int) fun onLatestClick(position: Int) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index af06bfb9d6..99e9b8fb0a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -53,15 +53,14 @@ 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 [SourcePresenter] - * [SourceAdapter.OnBrowseClickListener] call function data on browse item click. + * [SourceAdapter.SourceListener] call function data on browse item click. * [SourceAdapter.OnLatestClickListener] call function data on latest item click */ class SourceController : NucleusController(), FlexibleAdapter.OnItemClickListener, - SourceAdapter.OnBrowseClickListener, + SourceAdapter.SourceListener, RootSearchInterface, - BottomSheetController, - SourceAdapter.OnLatestClickListener { + BottomSheetController { /** * Application preferences. @@ -260,7 +259,7 @@ class SourceController : NucleusController(), /** * Called when browse is clicked in [SourceAdapter] */ - override fun onBrowseClick(position: Int) { + override fun onPinClick(position: Int) { val item = adapter?.getItem(position) as? SourceItem ?: return val isPinned = item.isPinned ?: item.header?.code?.equals(SourcePresenter.PINNED_KEY) ?: false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt index ae11e647fb..05e1358141 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt @@ -14,19 +14,12 @@ import kotlinx.android.synthetic.main.source_item.* class SourceHolder(view: View, val adapter: SourceAdapter) : BaseFlexibleViewHolder(view, adapter) { - /*override val slice = Slice(card).apply { - setColor(adapter.cardBackground) - } - - override val viewToSlice: View - get() = card*/ - init { source_pin.setOnClickListener { - adapter.browseClickListener.onBrowseClick(adapterPosition) + adapter.sourceListener.onPinClick(adapterPosition) } source_latest.setOnClickListener { - adapter.latestClickListener.onLatestClick(adapterPosition) + adapter.sourceListener.onLatestClick(adapterPosition) } } diff --git a/app/src/main/res/layout/manga_list_item.xml b/app/src/main/res/layout/manga_list_item.xml index e6d3eaa176..cf7520394e 100644 --- a/app/src/main/res/layout/manga_list_item.xml +++ b/app/src/main/res/layout/manga_list_item.xml @@ -22,7 +22,6 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0"> - diff --git a/app/src/main/res/layout/migration_card_item.xml b/app/src/main/res/layout/migration_card_item.xml index 4ec2ef2a2b..556a91a94c 100644 --- a/app/src/main/res/layout/migration_card_item.xml +++ b/app/src/main/res/layout/migration_card_item.xml @@ -36,26 +36,15 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@+id/edit_button" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintEnd_toStartOf="@+id/migration_auto" + app:layout_constraintEnd_toStartOf="@+id/migration_all" tools:text="Source title"/> - - Source migration Migration Skip pre-migration - Select a source to migrate from + Select a source, then select an item to + migrate Data to include in migration Search parameter (e.g. language:english) Include extra search parameter when searching