You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-guide/Advanced-Theming.asciidoc
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,15 @@ SoftKey, Touch, Bar, Title, Right, Native
186
186
|defaultEmblemImage
187
187
|The emblem painted on the side of the multibutton, by default this is an arrow on some platforms
188
188
189
+
|emblemUiid
190
+
|Overrides the UIID applied to emblem labels rendered by composite buttons such as `MultiButton` and `SpanMultiButton`.
191
+
192
+
|iconUiid
193
+
|Allows theming the icon component used by `SpanLabel`, `SpanButton`, `MultiButton`, and `SpanMultiButton` when they fetch icon styling via theme constants.
194
+
195
+
|textUiid
196
+
|Overrides the text component UIID for `SpanLabel`, `SpanButton`, `MultiButton`, and `SpanMultiButton` instances when provided as a theme constant.
197
+
189
198
|dialogTransitionOutImage
190
199
|Default transition https://www.codenameone.com/javadoc/com/codename1/ui/Image.html[Image] for dialog, causes a https://www.codenameone.com/javadoc/com/codename1/ui/animations/Timeline.html[Timeline] transition effect
191
200
@@ -279,6 +288,9 @@ SoftKey, Touch, Bar, Title, Right, Native
279
288
|infiniteDefaultColor
280
289
|Hex RGB color used for the auto-generated material spinner when `infiniteImage` isn't supplied. Defaults to `777777`
281
290
291
+
|interactionDialogSpeedInt
292
+
|Controls the duration in milliseconds that `InteractionDialog` uses when animating into and out of the layered pane (including the directional dispose helpers). Defaults to `400` if the constant is not defined.
293
+
282
294
|includeNativeBool
283
295
|True to derive from the platform native theme, false to create a blank theme that only uses the basic defaults
284
296
@@ -504,6 +516,15 @@ SoftKey, Touch, Bar, Title, Right, Native
504
516
|sideSwipeSensitiveInt
505
517
|Indicates the region of the screen that is sensitive to side swipe in the side menu bar, defaults to 10 (percent)
506
518
519
+
|sigButtonOKUIID
520
+
|Defines the UIID applied to the confirmation button in the signature capture dialog (defaults to `Button`).
521
+
522
+
|sigButtonResetUIID
523
+
|Defines the UIID applied to the reset/clear button in the signature capture dialog (defaults to `Button`).
524
+
525
+
|sigButtonCancelUIID
526
+
|Defines the UIID applied to the cancel button in the signature capture dialog (defaults to `Button`).
Copy file name to clipboardExpand all lines: docs/developer-guide/Animations.asciidoc
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ This won't work since these methods are meant for the layout manager, which is i
29
29
30
30
If you add components to a form that is currently showing, it is your responsibility to invoke `revalidate`/`layoutContainer` to arrange the newly added components (see <<layout-reflows,Layout Reflows>>).
31
31
32
-
`animateLayout()` method is a fancy form of revalidate that animates the components into their laid out position. After changing the layout & invoking this method the components move to their new sizes/positions seamlessly.
32
+
`animateLayout()` method is a fancy form of revalidate that animates the components into their laid out position. After changing the layout & invoking this method the components move to their new sizes/positions seamlessly. `Form` exposes convenience wrappers such as `animateLayout*()` that simply forward to the underlying content pane, so you can usually call the methods directly on the form unless you specifically need to animate a nested container.
33
33
34
34
This sort of behavior creates a special case where setting the size/position makes sense. When we set the size/position in the demo code here we are positioning the components at the animation start position above the frame.
There are a couple of things that you should notice about this example:
54
54
55
55
<1> We used a button to do the animation rather than doing it on show. Since `show()` implicitly lays out the components it wouldn't have worked correctly.
56
-
<2> We used `hi.getContentPane().animateLayout(20000);` & not `hi.animateLayout(20000);`. You need to animate the "actual" container and `Form` is a special case.
56
+
<2> We used `hi.animateLayout(20000);`, which delegates to the `Form` content pane. If you need to animate a specific container (e.g. a nested layout), call `animateLayout()` on that container instead.
While layout animations are really powerful effects for adding elements into the UI and drawing attention to them. The inverse of removing an element from the UI is often more important. E.g. when we delete or remove an element we want to animate it out.
73
73
74
-
Layout animations don't really do that since they will try to bring the animated item into place. What we want is the exact opposite of a layout animation and that is the "unlayout animation".
74
+
Layout animations don't really do that since they will try to bring the animated item into place. What we want is the exact opposite of a layout animation and that is the "unlayout animation". `Container.animateUnlayout(int, int, Runnable)` and the `Form.animateUnlayout*()` helpers let you trigger this transition either asynchronously (with a completion callback) or synchronously via the `AndWait` variants.
75
75
76
76
The "unlayout animation" takes a valid laid out state and shifts the components to an invalid state that we defined in advance. E.g. we can fix the example above to flip the "fall" button into a "rise" button when the buttons come into place and this will allow the buttons to float back up to where they came from in the exact reverse order.
@@ -112,7 +112,7 @@ You will notice some similarities with the unlayout animation but the difference
112
112
113
113
<1> We loop over existing components (not newly created ones)
114
114
<2> We set the desired end position not the desired starting position
115
-
<3> We used the `AndWait` variant of the animate unlayout call. We could have used the async call as well.
115
+
<3> We used the `animateUnlayoutAndWait(...)` variant to block until completion; `animateUnlayout(duration, opacity, callback)` provides the non-blocking alternative when you want to continue immediately and run code from a callback instead.
116
116
<4> After the animation completes we need to actually remove the elements since the UI is now in an invalid position with elements outside of the screen but still physically there!
117
117
118
118
==== Hiding & Visibility
@@ -121,9 +121,9 @@ A common trick for animating Components in Codename One is to set their preferre
121
121
122
122
Instead of using that trick you can use `setHidden`/`isHidden` who effectively encapsulate this functionality and a bit more.
123
123
124
-
One of the issues `setHidden` tries to solve is the fact that preferred size doesn't include the margin in the total and thus a component might still occupy space despite being hidden. To solve this the margin is set to `0` when hiding and restored to its original value when showing the component again by resetting the UIID (which resets all style modifications).
124
+
One of the issues `setHidden` tries to solve is the fact that preferred size doesn't include the margin in the total and thus a component might still occupy space despite being hidden. When you request the margin adjustment the current margins are cached, the component is given zero margins while hidden, and those cached values are restored when it is shown again—without resetting the UIID or other style state.
125
125
126
-
This functionality might be undesirable which is why there is a version of the `setHidden` method that accepts a boolean flag indicating whether the margin/UIID should be manipulated. You can effectively `hide`/`show` a component without deprecated code using something like this:
126
+
This functionality might be undesirable which is why there is a version of the `setHidden` method that accepts a boolean flag indicating whether the margin cache should be manipulated. You can effectively `hide`/`show` a component without deprecated code using something like this:
127
127
128
128
[source,java]
129
129
----
@@ -145,13 +145,13 @@ TIP: Notice that the code above uses `setVisible()`, which shouldn't be confused
145
145
146
146
Most animations have two or three variants:
147
147
148
-
- Standard animation e.g. `animateLayout(int)`
149
-
- And wait variant e.g. `animateLayoutAndWait(int)`
150
-
- Callback variant e.g. `animateUnlayout(int, int, Runnable)`
148
+
- Standard animation e.g. `animateLayout(int)` or the non-blocking `animateUnlayout(int, int, Runnable)`
149
+
- And wait variant e.g. `animateLayoutAndWait(int)` / `animateUnlayoutAndWait(int, int)`
150
+
- Callback variant e.g. `animateLayoutFade(int, int, Runnable)`
151
151
152
152
The standard animation is invoked when we don't care about the completion of the animation. We can do this for a standard animation.
153
153
154
-
NOTE: The unlayout animations don't have a standard variant. Since they leave the UI in an invalid state we must always do something once the animation completes so a standard variant makes no sense
154
+
NOTE: Unlayout animations always leave the container in an invalid state, so even the standard helper expects you to tidy up either in the callback or immediately after the animation finishes.
155
155
156
156
The `AndWait` variant blocks the calling thread until the animation completes. This is really useful for sequencing animations one after the other e.g this code from the kitchen sink demo:
157
157
@@ -180,7 +180,7 @@ The callback variant is similar to the `invokeAndBlock` variant but uses a more
0 commit comments