mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-29 02:23:21 -05:00
Fix MangaController toolbar title showing when editing category (#6005)
This commit is contained in:
parent
edb1d21ddc
commit
ef993515c6
1 changed files with 19 additions and 6 deletions
|
@ -53,6 +53,7 @@ import eu.kanade.tachiyomi.source.LocalSource
|
||||||
import eu.kanade.tachiyomi.source.Source
|
import eu.kanade.tachiyomi.source.Source
|
||||||
import eu.kanade.tachiyomi.source.SourceManager
|
import eu.kanade.tachiyomi.source.SourceManager
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
|
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.FabController
|
import eu.kanade.tachiyomi.ui.base.controller.FabController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.getMainAppBarHeight
|
import eu.kanade.tachiyomi.ui.base.controller.getMainAppBarHeight
|
||||||
|
@ -177,7 +178,7 @@ class MangaController :
|
||||||
|
|
||||||
private var trackSheet: TrackSheet? = null
|
private var trackSheet: TrackSheet? = null
|
||||||
|
|
||||||
private var dialog: MangaFullCoverDialog? = null
|
private var dialog: DialogController? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For [recyclerViewUpdatesToolbarTitleAlpha]
|
* For [recyclerViewUpdatesToolbarTitleAlpha]
|
||||||
|
@ -583,8 +584,7 @@ class MangaController :
|
||||||
}
|
}
|
||||||
}.toTypedArray()
|
}.toTypedArray()
|
||||||
|
|
||||||
ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected)
|
showChangeCategoryDialog(manga, categories, preselected)
|
||||||
.showDialog(router)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,8 +637,21 @@ class MangaController :
|
||||||
QuadStateTextView.State.UNCHECKED.ordinal
|
QuadStateTextView.State.UNCHECKED.ordinal
|
||||||
}
|
}
|
||||||
}.toTypedArray()
|
}.toTypedArray()
|
||||||
ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected)
|
showChangeCategoryDialog(manga, categories, preselected)
|
||||||
.showDialog(router)
|
}
|
||||||
|
|
||||||
|
private fun showChangeCategoryDialog(manga: Manga, categories: List<Category>, preselected: Array<Int>) {
|
||||||
|
if (dialog != null) return
|
||||||
|
dialog = ChangeMangaCategoriesDialog(this, listOf(manga), categories, preselected)
|
||||||
|
dialog?.addLifecycleListener(
|
||||||
|
object : LifecycleListener() {
|
||||||
|
override fun postDestroy(controller: Controller) {
|
||||||
|
super.postDestroy(controller)
|
||||||
|
dialog = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
dialog?.showDialog(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun updateCategoriesForMangas(mangas: List<Manga>, addCategories: List<Category>, removeCategories: List<Category>) {
|
override fun updateCategoriesForMangas(mangas: List<Manga>, addCategories: List<Category>, removeCategories: List<Category>) {
|
||||||
|
@ -822,7 +835,7 @@ class MangaController :
|
||||||
|
|
||||||
fun onSetCoverSuccess() {
|
fun onSetCoverSuccess() {
|
||||||
mangaInfoAdapter?.notifyDataSetChanged()
|
mangaInfoAdapter?.notifyDataSetChanged()
|
||||||
dialog?.setImage(manga)
|
(dialog as? MangaFullCoverDialog)?.setImage(manga)
|
||||||
activity?.toast(R.string.cover_updated)
|
activity?.toast(R.string.cover_updated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue