Slide vertical and horizontal forward or backward

Open an Close Screen Animation = Slide Horizontal

I would like to define the direction of the animation, whether it will be a slide to the right or to the left.

I have a sequence of screens with steps where the user fills in his data. Each screen is a step.

But when the user returns to the previous screen, I want to animate in the opposite direction.

It’s possible?