Added ability to search manga titles in collasped category

This commit is contained in:
Jay 2020-04-17 01:03:57 -04:00
parent a4178f5d28
commit f0cb967f6a
3 changed files with 12 additions and 6 deletions

View File

@ -15,8 +15,10 @@ class LibraryManga : MangaImpl() {
category = categoryId
}
fun createHide(categoryId: Int): LibraryManga = createBlank(categoryId).apply {
status = -1
}
fun createHide(categoryId: Int, title: String): LibraryManga =
createBlank(categoryId).apply {
this.title = title
status = -1
}
}
}

View File

@ -130,7 +130,7 @@ class LibraryItem(
* @return true if the manga should be included, false otherwise.
*/
override fun filter(constraint: String): Boolean {
if (manga.isBlank())
if (manga.isBlank() && manga.title.isBlank())
return constraint.isEmpty()
val sourceManager by injectLazy<SourceManager>()
val sourceName = if (manga.source == 0L) "Local" else

View File

@ -443,11 +443,15 @@ class LibraryPresenter(
)
)
} else if (catId in categoriesHidden) {
items.removeAll { it.manga.category == catId }
val mangaToRemove = items.filter { it.manga.category == catId }
val mergedTitle = mangaToRemove.joinToString("-") {
it.manga.title
}
items.removeAll(mangaToRemove)
val headerItem = headerItems[catId]
if (headerItem != null) items.add(
LibraryItem(
LibraryManga.createHide(catId),
LibraryManga.createHide(catId, mergedTitle),
libraryLayout,
preferences.uniformGrid(),
preferences.alwaysShowSeeker(),