This message was deleted.
# compose
s
This message was deleted.
n
Copy code
SwipeToRefreshLayout(
    refreshingState = viewModel.flag,
    onRefresh = {
        GlobalScope.launch(Dispatchers.Main){
            viewModel.result = getSentences()
        }
        viewModel.flag = true
    },
    refreshIndicator = {
        Surface(elevation = 10.dp, shape = CircleShape) {
            CircularProgressIndicator(
                modifier = Modifier
                    .size(40.dp)
                    .padding(8.dp)
            )
        }
    }) {
    ImageDemo(viewModel)
}
I tried to use SwipeToRefreshLayout, but I don't know how to Collapse Indicator
I wanted to collapse Indicator after I finished executing the getSentences() thread, so I set viewModel.flag to true, but it still doesn't collapse automatically