do exist an alternative to PagerTitleStrip ViewPag...
# compose
p
do exist an alternative to PagerTitleStrip ViewPager in compose? I mean that view where you have a upper title displaying the current screen, and where you can see the previous and next screens on the left and the right of the title, and were you can move to these screens with dragging the screen to left or to right
s
Check out HorizontalPager
p
that's similar, @Seri, but it doesn't display the previous and the next screen title in the upper part of the screen, maybe do you know if it's possible to add that functionality to HorizontalPager?
Unfortunatelly seems that Compose doesn't offer an alternative to PagerTitleStrip, I'm trying also to reproduce the same behaviour but I can't find the way. Maybe someone has found an alternative in Compose?
s
The HorizontalPager only handles the paged content, but it exposes a
pagerState
which you can use to create your own additional components which are informed by the pager status
For an example, see how a page indicator is added below the pager here: https://developer.android.com/develop/ui/compose/layouts/pager#add-page
p
that's better than nothing, but it doesn't display the titles, with the prev and next titles moving when you move the page
s
do you want the title to be static, and to change when the user scrolls? or do you want the title to move around with the content?
p
to move with the content, allowing you to see it like in the PagerTitleStrip

https://blog.kakaocdn.net/dn/KrdcP/btqDohrnlg5/fp6dlLR7LwXtPCiKBxQeH0/img.gif

PagerTitleStrip is a non-interactive indicator of the current, next, and previous pages of a
ViewPager
. It is intended to be used as a child view of a ViewPager widget in your XML layout.
this is missing in compose, or at least it seems to be missing
s
I don't believe this exists as a standard component, but I may be mistaken