Minor cleanup

This commit is contained in:
arkon
2022-05-11 22:17:12 -04:00
parent 37199a10bf
commit c7707dc50e
5 changed files with 14 additions and 15 deletions

View File

@@ -11,8 +11,7 @@ import eu.kanade.tachiyomi.ui.base.controller.DialogController
import eu.kanade.tachiyomi.ui.base.controller.pushController
import uy.kohesive.injekt.injectLazy
class AddDuplicateMangaDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
where T : Controller, T : AddDuplicateMangaDialog.Listener {
class AddDuplicateMangaDialog(bundle: Bundle? = null) : DialogController(bundle) {
private val sourceManager: SourceManager by injectLazy()
@@ -20,7 +19,7 @@ class AddDuplicateMangaDialog<T>(bundle: Bundle? = null) : DialogController(bund
private lateinit var onAddToLibrary: () -> Unit
constructor(
target: T,
target: Controller,
libraryManga: Manga,
onAddToLibrary: () -> Unit,
) : this() {
@@ -46,8 +45,4 @@ class AddDuplicateMangaDialog<T>(bundle: Bundle? = null) : DialogController(bund
.setCancelable(true)
.create()
}
interface Listener {
fun addToLibrary(newManga: Manga)
}
}

View File

@@ -113,7 +113,6 @@ class MangaController :
FlexibleAdapter.OnItemClickListener,
FlexibleAdapter.OnItemLongClickListener,
BaseChaptersAdapter.OnChapterClickListener,
AddDuplicateMangaDialog.Listener,
ChangeMangaCoverDialog.Listener,
ChangeMangaCategoriesDialog.Listener,
DownloadCustomChaptersDialog.Listener,
@@ -533,7 +532,7 @@ class MangaController :
trackSheet?.show()
}
override fun addToLibrary(newManga: Manga) {
private fun addToLibrary(newManga: Manga) {
val categories = presenter.getCategories()
val defaultCategoryId = preferences.defaultCategory()
val defaultCategory = categories.find { it.id == defaultCategoryId }