From 7a7c34af3c875fecd80ddd839e4388c23bf6560d Mon Sep 17 00:00:00 2001 From: Deltashot Date: Mon, 10 Oct 2022 22:40:52 +0200 Subject: [PATCH] fixing format --- .../tachiyomi/ui/library/LibraryPresenter.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index e15b921525..7a54bd4db7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -664,8 +664,9 @@ class LibraryPresenter( } fun removeSelected(mutableList: MutableList, manga: LibraryManga): Boolean { - if(selection.fastAny { it.manga.id == manga.manga.id }) - return mutableList.remove(manga); + if (selection.fastAny { it.manga.id == manga.manga.id }) { + return mutableList.remove(manga) + } return false } @@ -683,9 +684,9 @@ class LibraryPresenter( */ fun toggleRangeSelection(manga: LibraryManga) { val mutableList = state.selection.toMutableList() - if (!removeSelected(mutableList, manga) && - mutableList.fastAny{ it.category == manga.category }) { - + if (!removeSelected(mutableList, manga) && mutableList.fastAny + { it.category == manga.category } + ) { val items = (loadedManga[manga.category] ?: emptyList()).map { it.libraryManga } val lastMangaIndex = items.indexOf(mutableList.findLast { it.category == manga.category }) val curMangaIndex = items.indexOf(manga) @@ -693,7 +694,9 @@ class LibraryPresenter( true -> items.subList(curMangaIndex, lastMangaIndex) 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 { mutableList.add(manga) }