I’m using the `HorizontalPager` from accompanist l...
# compose
n
I’m using the
HorizontalPager
from accompanist library. In version
0.9.0
the
offscreenLimit
parameter was removed, but it’s still in the docs… Is there any replacement for this param? cc: @cb
c
We probably should have made that clearer. It’s now set on the pager state
n
Oh! you mean this? 👇
Copy code
rememberPagerState(
    pageCount = images.size,
    initialOffscreenLimit = 2
)
n
btw I have a bug where when we scroll to the last item, any scroll movement to the previous item will be "instant", without any animation/scroll. You touch the pager and it's instantly to the element before. It happens only for the last item though. I'll file a bug report but I want to isolate it in a reproducible sample project first. Do you have the same behavior ?
n
😮 @nitrog42 I just noticed that
n
good so I'm not the only one !
n
n
oh well I think the original ticket isn't about the same issue, but the comment and the PR linked is definitelly what happens for us so it should be fixed soon!
👍 1
c
The attached PR fixes that issue too. I’ll get it merged and a new release out tonight or tomorrow.
🙏 1
n
Thanks @cb! and congrats for you great job 😉
hey @cb. could you please take a look into this? https://stackoverflow.com/questions/67419418/how-to-add-swipe-behavior-to-the-screens/67420805 The bug we mentioned here in slack is fixed, but now I’m getting a different one…
c
What’s the new issue? I don’t see anything new there 🤔
n
When I scroll the last page back, the bottom tab is not updated. Usually from the last tab, but it also happened in the third tab.
c
And that is with
0.9.1
?
👍 1
We added a test which does exactly what you're doing in that demo (which is passing). Looks like a more nuanced issue somewhere https://github.com/google/accompanist/blob/main/pager/src/androidTest/java/com/google/accompanist/pager/PagerTest.kt#L86
n
Yes…
0.9.1.
😞
c
Found the issue, I won't be able to do another release though until next week
(you can use the snapshots if needed though)
n
Great! 👏 No worries 😉 I’m using in a playground repo. No rush
n
Awesome! Thanks again 😊
👍 1
a
offscreenLimit
has been completely removed now. @nglauber Have you found a solution to implement an
offscreenLimit
? 🙏
n
well you shouldn't need it anymore, as now the pager use a lazy mechanism
a
Well now the adjacent images do not load until I swipe to the item.
p
@allan.conda Have you found how to do it? I'm facing a similar issue.
a
Pager’s implementation is LazyColumn now, so I think it’s not possible until that API supports preloading. You can star my dead request 😄 https://issuetracker.google.com/issues/172029355