Compose HorizontalPager swipe conflict with swipe back event

39 Views Asked by At

I currently have an issue with HorizontalPager swipe behavior, when perform the Android swipe back gesture from either of the screen edges, the HorizontalPager also swipes to the next image. Here is the GIF of it. I'm using compose UI version 1.3.3

HorizontalPager(
        pageCount = pageCount,
        state = pagerState,
        modifier = Modifier.fillMaxSize()
      ) { page ->
        DefaultAsyncImage(
          modifier = Modifier.fillMaxSize(),
          imageUrl = urls[page],
          aspectRatio = PRODUCT_LAYOUT_ASPECT_RATIO
        )
      }

enter image description here

How can I prevent the HorizontalPager from consuming the swipe gesture when the swipe should only close the Activity?

0

There are 0 best solutions below