Added ability to search manga titles in collasped category
This commit is contained in:
parent
a4178f5d28
commit
f0cb967f6a
3 changed files with 12 additions and 6 deletions
|
@ -15,8 +15,10 @@ class LibraryManga : MangaImpl() {
|
||||||
category = categoryId
|
category = categoryId
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createHide(categoryId: Int): LibraryManga = createBlank(categoryId).apply {
|
fun createHide(categoryId: Int, title: String): LibraryManga =
|
||||||
status = -1
|
createBlank(categoryId).apply {
|
||||||
}
|
this.title = title
|
||||||
|
status = -1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ class LibraryItem(
|
||||||
* @return true if the manga should be included, false otherwise.
|
* @return true if the manga should be included, false otherwise.
|
||||||
*/
|
*/
|
||||||
override fun filter(constraint: String): Boolean {
|
override fun filter(constraint: String): Boolean {
|
||||||
if (manga.isBlank())
|
if (manga.isBlank() && manga.title.isBlank())
|
||||||
return constraint.isEmpty()
|
return constraint.isEmpty()
|
||||||
val sourceManager by injectLazy<SourceManager>()
|
val sourceManager by injectLazy<SourceManager>()
|
||||||
val sourceName = if (manga.source == 0L) "Local" else
|
val sourceName = if (manga.source == 0L) "Local" else
|
||||||
|
|
|
@ -443,11 +443,15 @@ class LibraryPresenter(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else if (catId in categoriesHidden) {
|
} 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]
|
val headerItem = headerItems[catId]
|
||||||
if (headerItem != null) items.add(
|
if (headerItem != null) items.add(
|
||||||
LibraryItem(
|
LibraryItem(
|
||||||
LibraryManga.createHide(catId),
|
LibraryManga.createHide(catId, mergedTitle),
|
||||||
libraryLayout,
|
libraryLayout,
|
||||||
preferences.uniformGrid(),
|
preferences.uniformGrid(),
|
||||||
preferences.alwaysShowSeeker(),
|
preferences.alwaysShowSeeker(),
|
||||||
|
|
Reference in a new issue