mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-18 12:39:20 +01:00
fixing format
This commit is contained in:
parent
c1ade84766
commit
7a7c34af3c
@ -664,8 +664,9 @@ class LibraryPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun removeSelected(mutableList: MutableList<LibraryManga>, manga: LibraryManga): Boolean {
|
fun removeSelected(mutableList: MutableList<LibraryManga>, manga: LibraryManga): Boolean {
|
||||||
if(selection.fastAny { it.manga.id == manga.manga.id })
|
if (selection.fastAny { it.manga.id == manga.manga.id }) {
|
||||||
return mutableList.remove(manga);
|
return mutableList.remove(manga)
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,9 +684,9 @@ class LibraryPresenter(
|
|||||||
*/
|
*/
|
||||||
fun toggleRangeSelection(manga: LibraryManga) {
|
fun toggleRangeSelection(manga: LibraryManga) {
|
||||||
val mutableList = state.selection.toMutableList()
|
val mutableList = state.selection.toMutableList()
|
||||||
if (!removeSelected(mutableList, manga) &&
|
if (!removeSelected(mutableList, manga) && mutableList.fastAny
|
||||||
mutableList.fastAny{ it.category == manga.category }) {
|
{ it.category == manga.category }
|
||||||
|
) {
|
||||||
val items = (loadedManga[manga.category] ?: emptyList()).map { it.libraryManga }
|
val items = (loadedManga[manga.category] ?: emptyList()).map { it.libraryManga }
|
||||||
val lastMangaIndex = items.indexOf(mutableList.findLast { it.category == manga.category })
|
val lastMangaIndex = items.indexOf(mutableList.findLast { it.category == manga.category })
|
||||||
val curMangaIndex = items.indexOf(manga)
|
val curMangaIndex = items.indexOf(manga)
|
||||||
@ -693,7 +694,9 @@ class LibraryPresenter(
|
|||||||
true -> items.subList(curMangaIndex, lastMangaIndex)
|
true -> items.subList(curMangaIndex, lastMangaIndex)
|
||||||
false -> items.subList(lastMangaIndex, curMangaIndex + 1)
|
false -> items.subList(lastMangaIndex, curMangaIndex + 1)
|
||||||
}
|
}
|
||||||
mutableList.apply { addAll(newList.filterNot { it in selection }.map { it }) }
|
mutableList.apply {
|
||||||
|
addAll(newList.filterNot { it in selection }.map { it })
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mutableList.add(manga)
|
mutableList.add(manga)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user