https://kotlinlang.org logo
#compose
Title
# compose
c

Can Korkmaz

08/01/2022, 11:56 AM
Hi, I'm trying to implement a swipe refresh behaviour in the middle of the screen, where the screen as a whole needs to be scrollable. Since Accompanist swipe refresh requires its child to be scrollable and I want the whole page to move (scroll) at once, I couldn't think of a way for days now.
Copy code
Column(
    Modifier
        .fillMaxSize()
        .verticalScroll(scrollState)
        .background(colorResource(id = R.color.colorBackground))
) {
           SwipeRefresh(state = swipeRefreshState, onRefresh = {
              scope.launch {
                pagingData.refresh()
                delay(TradeHistoryFragment.REFRESH_ATTEMPT_DELAY)
              }
        }) {
               Column(Modifier.fillMaxWidth().wrapContentHeight()) {
👀 1
It would be really perfect If I could just surround items{} with SwipeRefresh but since LazyColumn scope is SubComposeLayout? It doesn't allow to take it as the child.
j

jossiwolf

08/02/2022, 11:28 AM
@Izer Onadim
7 Views