From 5138fc1a49e91c36f7fe2bc0317d19af80e14a6d Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sat, 30 Apr 2022 14:53:10 -0400 Subject: [PATCH] fixes to format of LinearLayoutManagerAccurateOffset --- .../tachiyomi/widget/LinearLayoutManagerAccurateOffset.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/LinearLayoutManagerAccurateOffset.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/LinearLayoutManagerAccurateOffset.kt index cecfc65cc9..d6a4af1dc1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/LinearLayoutManagerAccurateOffset.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/LinearLayoutManagerAccurateOffset.kt @@ -104,9 +104,11 @@ fun RecyclerView.LayoutManager.getFirstPos(recyclerView: RecyclerView?, toolbarH .mapNotNull { getChildAt(it) } .filter { val isLibraryHeader = getItemViewType(it) == R.layout.library_category_header_item - val bottom = (if (isLibraryHeader) { - it.findViewById(R.id.category_title)?.bottom?.plus(it.y)?.roundToInt() - } else it.bottom) ?: it.bottom + val bottom = ( + if (isLibraryHeader) { + it.findViewById(R.id.category_title)?.bottom?.plus(it.y)?.roundToInt() + } else it.bottom + ) ?: it.bottom bottom >= inset + toolbarHeight && it.height > 0 } .mapNotNull { pos -> getPosition(pos).takeIf { it != RecyclerView.NO_POSITION } }