admin管理员组文章数量:1277293
I'm using Jetpack Compose and working with BottomSheetScaffold. I'm trying to understand the difference between various states like:
1.Showing the bottom sheet
2.Expanding the bottom sheet
3.Partially expanding the bottom sheet
4.Hiding the bottom sheet
I am confusing show() and expand() and partiallyExpand() in material 3.
I'm using Jetpack Compose and working with BottomSheetScaffold. I'm trying to understand the difference between various states like:
1.Showing the bottom sheet
2.Expanding the bottom sheet
3.Partially expanding the bottom sheet
4.Hiding the bottom sheet
I am confusing show() and expand() and partiallyExpand() in material 3.
Share Improve this question asked Feb 24 at 6:21 Santhosh KumarSanthosh Kumar 5391 silver badge11 bronze badges1 Answer
Reset to default 2Please make yourself familiar with the official documentation of Material3, there you can find the SheetState
class:
suspend fun expand(): Unit
[...] fully expand the bottom sheet with animation and suspend until it is fully expanded or animation has been cancelled.
suspend fun show(): Unit
[...] expand the bottom sheet with animation and suspend until it is PartiallyExpanded if defined, else Expanded.
So expand
opens the BottomSheet fully, while show
opens it only until PartiallExpanded
if that is enabled for the BottomSheet.
val bottomSheetState = rememberBottomSheetScaffoldState(
SheetState(skipPartiallyExpanded = true)
)
In above code sample, both would behave the same way.
本文标签:
版权声明:本文标题:android - Difference Between show, expand, partially expand, and hide in BottomSheetScaffold (Jetpack Compose) [Material 3] - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741290273a2370508.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论