I am playing with Transitions on Android. I believe I am setting my layout wrong.
First, when you arrive I have this kind of layout:
Everything is extended from View class.
For now I don't put the code, it is 300 lines.
Then, when you click on a circle, the given elements (the orange one for example) goes to the top of the screen, using animations:
Every other shape goes off the screen, and the circle goes to the left.
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:transitionOrdering="together">
<slide android:duration="2000" android:slideEdge="start">
<targets>
<target android:targetId="@id/relativeFragmentBLUE" />
</targets>
</slide>
<slide android:duration="2000" android:slideEdge="end">
<targets>
<target android:targetId="@id/relativeFragmentGREEN" />
<target android:targetId="@id/relativeFragmentRED" />
</targets>
</slide>
<changeBounds android:duration="2000">
<targets>
<target android:targetId="@id/relativeFragmentORANGE" />
<target android:targetId="@id/circleORANGE" />
</targets>
</changeBounds>
</transitionSet>
The result scene is here:
But Animations are not really working.
When I go back from any scene to the Menu, it work perfectly!
1) To get Transition working nicely, the "orange scene layout" has all the other shapes defined, set to invisible. Is it what I'm supposed to do?
2) There are many layouts inside layouts inside layouts (like 8 times). I believe stacking many layouts are breaking the Transitions?
3) To make this work, I had to set empty blocks, and stack 2 layouts. This is where I fail. How can u make a layout like that? (I'm using weight and alignParent, it works but maybe not done well.)
4) I made an animation on the circles before starting the Transition, but it doesn't execute. I believe you can't stack an Animation and a Transition? (even with startDelay)
I repeat, the Transitions are perfect from any scene to the Menu. So the problems comes from my scenes layouts.