@@ -35,7 +35,7 @@ This sort of behavior creates a special case where setting the size/position mak
3535
3636[source,java]
3737----
38- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LayoutAnimationsDemo.java[tag=layoutAnimations,indent=-8 ]
38+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LayoutAnimationsDemo.java[tag=layoutAnimations,indent=0 ]
3939----
4040
4141There are a couple of things that you should notice about this example:
@@ -68,7 +68,7 @@ WARNING: An unlayout animation always leaves the container in an invalidated sta
6868[[animateUnlayutSampleCode]]
6969[source,java]
7070----
71- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/UnlayoutAnimationsDemo.java[tag=unlayoutAnimation,indent=-8 ]
71+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/UnlayoutAnimationsDemo.java[tag=unlayoutAnimation,indent=0 ]
7272----
7373
7474You will notice some similarities with the unlayout animation but the differences represent the exact opposite of the layout animation:
@@ -90,7 +90,7 @@ This functionality might be undesirable which is why there is a version of the `
9090
9191[source,java]
9292----
93- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/HiddenComponentDemo.java[tag=hiddenComponent,indent=-8 ]
93+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/HiddenComponentDemo.java[tag=hiddenComponent,indent=0 ]
9494----
9595
9696TIP: Notice that the code above uses `setVisible()`, which shouldn't be confused with `setHidden`. `setVisible()` just toggles the visibility of the component it would still occupy the same amount of space
@@ -111,7 +111,7 @@ The `AndWait` variant blocks the calling thread until the animation completes. T
111111
112112[source,java]
113113----
114- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationSynchronicityDemo.java[tag=animationSequence,indent=-8 ]
114+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationSynchronicityDemo.java[tag=animationSequence,indent=0 ]
115115----
116116
117117First the UI goes thru an "unlayout" animation, once that completes the layout itself is performed.
@@ -132,7 +132,7 @@ The callback variant is similar to the `invokeAndBlock` variant but uses a more
132132
133133[source,java]
134134----
135- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/UnlayoutAnimationsDemo.java[tag=unlayoutCallback,indent=-8 ]
135+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/UnlayoutAnimationsDemo.java[tag=unlayoutCallback,indent=0 ]
136136----
137137
138138===== Animation Fade and Hierarchy
@@ -145,7 +145,7 @@ Some animate layout methods are hierarchy based. They work just like the regular
145145
146146[source,java]
147147----
148- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/HierarchyAnimationDemo.java[tag=hierarchyAnimation,indent=-8 ]
148+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/HierarchyAnimationDemo.java[tag=hierarchyAnimation,indent=0 ]
149149----
150150
151151The `demoComponents` `Vector` contains components from separate containers and this code would not work with a simple animate layout.
@@ -159,7 +159,7 @@ This effectively prevents two animations from mutating the UI in parallel so we
159159
160160[source,java]
161161----
162- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerProblem,indent=-8 ]
162+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerProblem,indent=0 ]
163163----
164164
165165The reason this happens is that the second remove gets postponed to the end of the animation so it won't break the animation. This works for remove and add operations on a https://www.codenameone.com/javadoc/com/codename1/ui/Container.html[Container] as well as other animations.
@@ -168,7 +168,7 @@ The simple *yet problematic* fix would be:
168168
169169[source,java]
170170----
171- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerWait,indent=-8 ]
171+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerWait,indent=0 ]
172172----
173173
174174So why that might still fail?
@@ -185,7 +185,7 @@ We can flush the animation queue and run synchronously after all the animations
185185
186186[source,java]
187187----
188- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerFlush,indent=-8 ]
188+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/AnimationManagerDemo.java[tag=animationManagerFlush,indent=0 ]
189189----
190190
191191=== Low Level Animations
@@ -206,12 +206,12 @@ E.g. you can add additional animation logic using code like this:
206206
207207[source,java]
208208----
209- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LowLevelAnimationDemo.java[tag=registerAnimated,indent=-8 ]
209+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LowLevelAnimationDemo.java[tag=registerAnimated,indent=0 ]
210210----
211211
212212[source,java]
213213----
214- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LowLevelAnimationDemo.java[tag=lowLevelAnimate,indent=-8 ]
214+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/LowLevelAnimationDemo.java[tag=lowLevelAnimate,indent=0 ]
215215----
216216
217217==== Why Not Just Write Code In Paint?
@@ -273,7 +273,7 @@ To apply a transition to a component we can just use the `Container.replace()` m
273273
274274[source,java]
275275----
276- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/ReplaceTransitionDemo.java[tag=replaceTransition,indent=-8 ]
276+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/ReplaceTransitionDemo.java[tag=replaceTransition,indent=0 ]
277277----
278278
279279TIP: Replace even works when you have a layout constraint in place e.g. replacing a component in a border layout will do the "right thing". However, some layouts such as `TableLayout` might be tricky in such cases so we recommend wrapping a potentially replaceable `Component` in a border layout and replacing the content.
@@ -293,7 +293,7 @@ The code below demonstrates the usage of all the main transitions:
293293
294294[source,java]
295295----
296- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SlideTransitionsDemo.java[tag=slideTransitions,indent=-8 ]
296+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SlideTransitionsDemo.java[tag=slideTransitions,indent=0 ]
297297----
298298
299299
@@ -340,7 +340,7 @@ NOTE: The code below manipulates styles and look. This is done to make the code
340340
341341[source,java]
342342----
343- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/BubbleTransitionDemo.java[tag=bubbleTransition,indent=-8 ]
343+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/BubbleTransitionDemo.java[tag=bubbleTransition,indent=0 ]
344344----
345345
346346.Bubble transition converting a circular button to a Dialog
@@ -371,7 +371,7 @@ forms so the transition will be able to find them.
371371
372372[source,java]
373373----
374- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/MorphTransitionDemo.java[tag=morphTransition,indent=-8 ]
374+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/MorphTransitionDemo.java[tag=morphTransition,indent=0 ]
375375----
376376
377377==== SwipeBackSupport
@@ -380,7 +380,7 @@ iOS7+ allows swiping back one form to the previous form, Codenmae One has an API
380380
381381[source,java]
382382----
383- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SwipeBackSupportDemo.java[tag=swipeBackBind,indent=-8 ]
383+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SwipeBackSupportDemo.java[tag=swipeBackBind,indent=0 ]
384384----
385385
386386That one command will enable swiping back from `currentForm`. https://www.codenameone.com/javadoc/com/codename1/util/LazyValue.html[LazyValue] allows us to pass a value lazily:
@@ -410,5 +410,5 @@ The code below should work for the transition sample above. Notice that this API
410410
411411[source,java]
412412----
413- include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SwipeBackSupportDemo.java[tag=swipeBackBindExample,indent=-8 ]
413+ include::../demos/common/src/main/java/com/codenameone/developerguide/animations/SwipeBackSupportDemo.java[tag=swipeBackBindExample,indent=0 ]
414414----
0 commit comments