onebone / compose-collapsing-toolbar

A simple implementation of collapsing toolbar for Jetpack Compose
MIT License
522 stars 72 forks source link

SwipeRefresh as a child doesn't expand #63

Open TepesLucian opened 2 years ago

TepesLucian commented 2 years ago

Not sure if it's an issue related to #18 but having SwipeRefresh as a child of the body blocks the toolbar from expanding. You can only expand the toolbar on a fling or when the SwipeRefresh is refreshing. View system components first expand the toolbar then activates Swiperefreshlayout pull gesture.

roberto-corchero-jt commented 1 year ago

Hello! I have found a workaround, you can use the SwipeRefresh param swipeEnabled in combination with the scaffold toolbarState progress to fix this:

SwipeRefresh(
        swipeEnabled = scaffoldState.toolbarState.progress == 1f,
        state = refreshState,
        onRefresh = onRefresh,
        modifier = modifier,
)