mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
fix seed job leak and viewport fill top padding
This commit is contained in:
@@ -23,7 +23,8 @@ fun rememberViewportFill(state: LazyListState): Dp {
|
||||
FILL_EPSILON_PX
|
||||
} else {
|
||||
val contentBottom = visibleReal.maxOf { it.offset + it.size }
|
||||
(info.viewportSize.height - info.afterContentPadding - contentBottom).coerceAtLeast(0) + FILL_EPSILON_PX
|
||||
val padding = info.beforeContentPadding + info.afterContentPadding
|
||||
(info.viewportSize.height - padding - contentBottom).coerceAtLeast(0) + FILL_EPSILON_PX
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,7 +43,8 @@ fun rememberViewportFill(state: LazyGridState): Dp {
|
||||
FILL_EPSILON_PX
|
||||
} else {
|
||||
val contentBottom = visibleReal.maxOf { it.offset.y + it.size.height }
|
||||
(info.viewportSize.height - info.afterContentPadding - contentBottom).coerceAtLeast(0) + FILL_EPSILON_PX
|
||||
val padding = info.beforeContentPadding + info.afterContentPadding
|
||||
(info.viewportSize.height - padding - contentBottom).coerceAtLeast(0) + FILL_EPSILON_PX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,8 @@ object ArtworkSeedCache {
|
||||
): Pair<Int, Int?>? {
|
||||
cache.get(ref.cacheKey)?.let { return it }
|
||||
val job = jobs.computeIfAbsent(ref.cacheKey) { scope.async { resolve(context, ref) } }
|
||||
val seeds = job.await()
|
||||
jobs.remove(ref.cacheKey, job)
|
||||
return seeds
|
||||
job.invokeOnCompletion { jobs.remove(ref.cacheKey, job) }
|
||||
return job.await()
|
||||
}
|
||||
|
||||
fun prefetch(
|
||||
|
||||
Reference in New Issue
Block a user