admin管理员组

文章数量:1389892

I’m implementing an Android app using Jetpack Compose. My screen has a bottom sheet that can be dragged from a partially visible state to fully expanded or fully collapsed. Behind the bottom sheet, there’s a text element that I want to fade out as the bottom sheet is dragged up and fade back in as the bottom sheet is dragged down.

Here’s what I’ve tried so far:

I used ModalBottomSheetLayout with rememberModalBottomSheetState to manage the bottom sheet’s state.

I tracked the bottom sheet’s progress using bottomSheetState.progress.fraction.

I used animateFloatAsState to animate the text’s opacity based on the bottom sheet’s progress.

本文标签: