I've looked around for a while and cant find the answer. How do you make a screen transition so that the background stays in place while the elements displayed move? Basically, Im trying to emulate the look for sliding through pages of apps on an iphone or android phone. Any way to do this? Do i have to use fragments? This question has kind of bad wording, ask me to clarify if you're confused on anything.
Asked
Active
Viewed 67 times
0
-
I think you want "Shared Element Transitions". Google it, there are lots of resources. – Aditya Naique Sep 13 '15 at 22:00
1 Answers
3
Use a frame layout with the background set as an image that you want. with a view pager as a child view. The view pager will use different fragments and the view pager should have each Fragment with a transparent background. Let me know if you need help with that any more, it should work no problem.
If the background is more complicated, use another layout to hold child views and still have the main layout be a frame layout. You want the frame layout because it can stack views on top of eachother. Put the view pager as the last view in this case, and ensure each Fragment is transparent.

Lucas Crawford
- 3,078
- 2
- 14
- 25
-
If the background is a single drawable, then setting ViewPager background would be sufficient, so no need for parent frame layout – maciekjanusz Sep 13 '15 at 22:22
-
Ok I'll look into this and get back to you when i have time. Thanks! – Luke Wang Sep 14 '15 at 02:50