Status Update
Comments
jo...@google.com <jo...@google.com> #2
Thanks for the report! We identified the issue and are looking at possible fixes.
ph...@lu.ma <ph...@lu.ma> #3
This is still happening with the latest compose 1.4.0-alpha06. Any ETA for a proper fix?
jo...@google.com <jo...@google.com> #4
Hi, 1.4.0-alpha06 did not include a fix for this. We are working on the fix and are aiming to include it in one of the next releases.
ro...@osome.com <ro...@osome.com> #5
1.4.0-beta01 and 1.4.0-beta02 are out and the crash is still there. What is delaying the fix for so long?
ap...@google.com <ap...@google.com> #6
ap...@google.com <ap...@google.com> #7
[Deleted User] <[Deleted User]> #8
Branch: androidx-main
commit 8cfec3ca487c6f0102eeceab5e57939b36162908
Author: Jossi Wolf <jossiwolf@google.com>
Date: Wed Feb 15 22:25:44 2023
Snap opportunistically in Modal Bottom Sheet
We now use the trySnapTo API to attempt to snap immediately, instead
of launching a coroutine that would most likely only run in the next
frame.
Since we rely on the anchor change handler to initialize the
Swipeable state by snapping if no anchor is found for the initial
value, we need to update the offset immediately, not only a frame
later.
Relnote: "Fixed an issue where ModalBottomSheetLayout would crash
in an edge case on orientation change. Layout animations (e.g.
`Modifier.animateContentSize`) in/on the sheet content now work
smoothly."
Test: modalBottomSheet_anchorChangeHandler_missingAnchor
_immediatelySnapsForInitialization
Bug: 266780234
Change-Id: I2f981d892f163254f0282d6874fb860aae5d0992
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ModalBottomSheetTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
ph...@gmail.com <ph...@gmail.com> #9
Is the fix from #8 supposed to be included in 1.4.0-rc01
? Because I can still reproduce it with this version.
pr...@google.com <pr...@google.com> #10
In androidx.compose.material3:material3:1.1.0-alpha08
, switching screen orientation has been fixed. However, the same problem still occurs when switching to dark mode.
ju...@google.com <ju...@google.com> #11
#9, the fix will be included in the next release.
#10, this issue is about M2's ModalBottomSheetLayout
. If you are encountering this issue with another component, can you file a new issue?
na...@google.com <na...@google.com> #12
#9, the fix will be included in the next release.
Do you mean the next 1.4 release? Thanks.
Description
System
ModalBottomSheet
hides scrim quite early after you start swiping - I guess it indicates that sheet is gonna be dismissed at this point.I prefer to have a progressive scrim alpha - it drops smoothly to zero when the sheet is completely closed.
In Compose 1.3.0 I was using
ModalBottomSheetState.progress
to calculate scrim alpha depending on swipe progress.Looks like
SwipeableV2State
API is different fromSwipeableState
at this point. I guess that I can useModalBottomSheetState.currentValue
/ModalBottomSheetState.targetValue
instead ofSwipeableState.progress.from
/SwipeableState.progress.to
, but I still needSwipeableState.progress.friction
which seems likeSwipeableV2State.progress
now.Could you make it publicly available with
ModalBottomSheetState.progress
?