# compose

Travis Griggs

02/21/2023, 9:09 PM
I want to prototype something like the Jetsnack example, own/modified theme, nav bar at the bottom. Unlike Jetsnack, I want to use a HorizontalPager from Accompanist to swap pages rather than the NavHost (unless its possible to configure a NavHost to animate changes by horizontal changes?). When I see the following about HorizontalPager--"Pager (Soon to be deprecated - Upstreamed in Compose 1.4)"--I'm a little confused how to proceed? I'm just using whatever Compose version is stock with the Eel version of Studio. Will whatever replaces it be similar? How far off is that?

Ben Trengrove [G]

02/21/2023, 9:14 PM
1.4 is in beta now and has a Pager composable. You can read the migration guide here, it hasn't been merged yet but is basically ready.

Ian Lake

02/21/2023, 9:18 PM
unless its possible to configure a NavHost to animate changes by horizontal changes?
You can certainly use
transitions with Accompanist Navigation Animation, but you won't get the swiping gesture part of HorizontalPager - you'd need to write your own
implementation to do that (which is also possible and fully supported - that's how Wear Compose's


02/21/2023, 11:26 PM
Just be aware there are some conceptual differences with pager. It has a loose assumption that the number of pages is fixed. And it doesn't have different viewmodel owners, so you'll need to manage screen state.

Travis Griggs

02/22/2023, 5:49 PM
@Ian Lake this is actually just want I want. I don't want the swipe. I just want my pages to transition side to side matching the direction of the selection on the bar at the bottom. I'll do some more research on nav stuff it looks like.