Search code examples
androidandroid-jetpack-composejetpack-compose-accompanist

How to add Swipe refresh from bottom of screen in compose?


I need to create a reader screen for a book reader app in android and I need to have a a composable like swipe refresh that comes from the bottoms of page so the users go to next page.

I tried a google Accompanist vertical pager and swipe refresh and in all of them swipe refresh comes from top of screen. is there any alternative for swipe refresh that comes from bottom of screen? or even a something that replicate dragging from bottom of screen.

thanks in advance.


Solution

  • Accompanist doesn't support it so far.

    There's a pull request, which should enable such feature on specifying indicatorAlignment = Alignment.BottomCenter, but right now this alignment only changes indicator placing - you still have to pull from top to refresh.

    Until this request is merged, you can try to copy the source code from this folder directly into your project, but I'm not sure how bug-free it is.