One of the things people asked about the MWC application is how did we get the native theme to apply to the different platforms. The answer is quite simple: when you create a new theme In the Codename One designer the first option is: "Native Theme".
When you look at this theme it seems empty however it assumes the iOS look by default. You can change the "native preview" by selecting the "Native Theme" menu in the menu bar and selecting the OS. You can pick an arbitrary native theme which can be used when targeting J2ME where no "actual" native theme exists.
This allows you to preview how your UI will look in different platforms and adapt the theme to make the appearance fit a different platform aesthetics.
The old themes that don't "derive" from the native look and feel are all there, the thing that makes this theme "special" is the "includeNativeBool" flag which automatically injects the native OS theme before loading this theme. This allows us to "override" or add UIID's for various platforms.
You can also add a platform override to a specific theme: by selecting the "Override In Platform" combo box and pointing it to the platform in which you need something different. E.g. override icons for a specific platform.
There is currently a bug on this that is reproducible only on one machine (and doesn't reproduce with the debugger) so I won't go too much into the details of this feature for now.
Tuesday, February 28, 2012
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment