I have a problem with the `PullRefreshIndicator` ...
# compose
n
I have a problem with the
PullRefreshIndicator
which stays stuck halfway down the screen and does not execute the function. Please see code in thread.
Copy code
val isRefreshing by viewModel.isRefreshing.collectAsState()
    val pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = {
                viewModel.updateLocalFeeds()
    })

 Scaffold(
        vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
        positionIndicator = { PositionIndicator(scalingLazyListState = scalingLazyListState) },
        timeText = { TimeText() }
    ) {
        when {
            state.isLoading -> {
                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
                    CircularProgressIndicator()
                }
            }
            state.isSuccess -> {
                Box(modifier = Modifier.pullRefresh(pullRefreshState)) {
                    ScalingLazyColumn(
                        state = scalingLazyListState,
                        modifier = Modifier.fillMaxWidth(),
                        anchorType = ScalingLazyListAnchorType.ItemStart,
                        contentPadding = PaddingValues(
                            horizontal = 8.dp,
                        ),
                        horizontalAlignment = Alignment.CenterHorizontally
                    ) {
                        item {
                            if (title != null) {
                                Text(
                                    text = title, textAlign = TextAlign.Center,
                                    modifier = Modifier.padding(
                                        top = 30.dp,
                                        start = 20.dp,
                                        end = 20.dp,
                                        bottom = 10.dp
                                    )
                                )
                            }

                        }
                        items(state.newsFeedItems) { item ->
                            ResultsChip(item, navController)
                        }
                    }
                    PullRefreshIndicator(
                        modifier = Modifier.align(Alignment.TopCenter),
                        refreshing = isRefreshing,
                        state = pullRefreshState,
                    )
                }
            }
Any ideas?
a
There was bug preventing the indicator from resetting that's been fixed: https://android-review.googlesource.com/c/platform/frameworks/support/+/2307790 Maybe this is what you're seeing and you just need to update to the latest version.
n
Oh ok, thanks for this!