Fix crash when calculating scroll
See original GitHub issueIdea Description
Fatal Exception: java.lang.IllegalStateException
Offset is unspecified
androidx.compose.ui.geometry.Offset.getX-impl (Offset.java:28)
io.github.droidkaigi.confsched2022.feature.sessions.ScreenScrollState$scroll$2$1.invokeSuspend (ScreenScrollState.java:31)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:8)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:100)
suspend fun scroll(
dragAmount: Offset,
timeMillis: Long,
position: Offset,
) {
val nextPossibleX = calculatePossibleScrollX(dragAmount.x)
val nextPossibleY = calculatePossibleScrollY(dragAmount.y)
scrollState.scroll(
Offset(nextPossibleX, nextPossibleY), // ←
value class Offset internal constructor(internal val packedValue: Long) {
@Stable
val x: Float
get() {
// Explicitly compare against packed values to avoid auto-boxing of Size.Unspecified
check(this.packedValue != Unspecified.packedValue) {
"Offset is unspecified" // ←
}
return unpackFloat1(packedValue)
}
Reference images and links
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
List of a lot of items crash when scrolling in SwiftUI, How can I ...
The problem is the geometry reader. The GeometryReader shouldn't be inside a ScrollView because it will cause a memory leak. So, whenever we ......
Read more >Finder crashing when scrolling through folders - CNET
Finder crashing when scrolling through folders ... Unfortunately there is no apparent fix for this issue, but people have at least found ...
Read more >Understanding Source of Crashes - Power Platform Community
Aside from a persistent issue where scrolling through a large gallery very quickly will cause a crash, there doesn't seem to be any...
Read more >UIStackView not laying out as expected in a UIScrollView
I'm attempting to put a (vertical) UIStackView in a UIScrollView, but it doesn't seem to want to scroll. Instead it it squishing all...
Read more >[Skyrim] Tutorial: Fixing Crash to Desktop & Improving ...
[Main Theme] Elder Scrolls Adventures: Redguard Bethesda Softworks Multiple Themes Elder Scrolls 3: Morrowind/Tribunal/Bloodmoon Bethesda ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Tomoyuki-TAKEZAKI I’m looking forward to seeing your PR! Assigned 👍