I have 3 activities, A, B, C.
From A they navigate to B, so I want to slide A to the left, and B from the right. When they navigate back to A from B, I want to slide B out to the right and A in from the left.
So it feels like they are just scrolling across 3 panes side by side like this:
I'm trying to do this in styles:
<style name="MyAnimation.WindowFromRight" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/slide_in_left</item>
<item name="android:windowExitAnimation">@anim/slide_out_right</item>
</style>
<style name="MyAnimation.WindowFromLeft" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/slide_in_right</item>
<item name="android:windowExitAnimation">@anim/slide_out_left</item>
</style>
<style name="ThemeFromLeft" parent="AppBaseTheme">
<item name="android:windowAnimationStyle">@style/MyAnimation.WindowFromLeft</item>
</style>
<style name="ThemeFromRight" parent="AppBaseTheme">
<item name="android:windowAnimationStyle">@style/MyAnimation.WindowFromRight</item>
</style>
However, the rules for B are complex, so it doesn't fit any of the styles above. B slides out to the left when C is being brought in, and out to the right when A is being brought in. And vice-versa for when B is coming into view.
I have tried to overridePendingTransition
to cope with the special cases but it seems to conflict and animations seem to be compounded, should that be the case?
So my question is, can this be achieved with styles?