Questions tagged [horizontal-pager]

9 questions
4
votes
0 answers

Pages beyond the bounds of HorizontalPager never call onDispose | Jetpack Compose

I've found strange behavior in HorizontalPager. Pages beyond the bounds never call onDispose inside DisposableEffect. In other words, what kind of key DisposableEffect must consume in order to trigger onDispose once the page becomes "inactive"(stops…
1
vote
1 answer

JetpackCompose - Horizontal Pager Indicator click functionality

I am working on sample where I want to display items using HorizontalPager. I am able to display pages horizontally scrollable without issues. Also able to place indicators using HorizontalPagerIndicator. Issue: When I click on pager Indicator I am…
0
votes
0 answers

How to sync TabRow indicator with HorizontalPager scroll offset?

Accompanist has https://google.github.io/accompanist/api/pager-indicators/com.google.accompanist.pager/pager-tab-indicator-offset.html Without it, the indicator just jumps to end positions, doesn't mirror the scroll offset "per pixel" Is this or…
urSus
  • 12,492
  • 12
  • 69
  • 89
0
votes
0 answers

Handling InteractionSources from HorizontalPager and child content (design question)

Context I am in the process of making a custom component that is similar to the BannerAd view. In my case, it is a fairly simple component that uses a HorizontalPager to display images. Here are the pertinent features I want my component to…
0
votes
0 answers

Can't provide graphicLayer{ translationZ = 1 } to pages in HorizontalPager, neither zIndex() would make any effect

I want to be able to arrange the HorizontalPager pages so I end up with the shown effect. The problem is that I can't find a way to make the next pages go behind the currentPage. I've tried zIndex() with no results, and graphicLayer{} modifier…
0
votes
0 answers

Why does HorizontalPager not remember PagerState when it is stored in a ViewModel or a global?

Whenever I try to move the pager state from the composable to my viewmodels the pager state stops remembering and the currently selected page is reset to zero on screen rotation changes. Here, I'm pasting a full working example where there are two…
0
votes
0 answers

How to view a svg. Image in HorizontalPager

I've got a HorizonalPager and following code ... HorizontalPager( pageCount = itemList.size, state = PagerState(), key = { itemList[it] } ) { index -> Image(painter = painterResource(id = itemList[index]),…
VFarkas2023
  • 295
  • 1
  • 1
  • 8
0
votes
1 answer

Horizontal pager misbehaving after the last item scroll

I'm using the pageSize attribute with a fixed width of 282.dp but when scrolling after the last item the scroll takes while after returning to the normal position and if another vertical scroll happens it will stuck as stretched out (due to…
-1
votes
0 answers

Android Jetpack Compose : HorizontalPager's pageContent called multiple times

I am trying to implement the following UI using ScrollableTabRow(), HorizontalPager(), and LazyColumn(), where LazyColumn will be available inside HorizontalPager as a pageContent. So now the problem is when I swipe between pages of HorizontalPager…