Skip to content

An Helper class for basic styling in Codename One, which provides an alternative to having endless UDIDs

License

Notifications You must be signed in to change notification settings

diamonddevgroup/cn1-Helper

Repository files navigation

cn1-Helper

A Helper library for basic styling using code in Codename One. This eliminates the need to have endless UIID in your GUI builder

Download Helper.cn1Lib to the Lib folder of your project. Go to your project and do Refresh cn1Lib files. Call new Helper(myCmp) only AFTER setUIID() method and not BEFORE.

JavaDoc

View the project JavaDoc here.

Usage example

Basic styling of a single component

 Label myLabel = new Label("Test Label");
 new Helper(myLabel).pa1().ma0().textGreen().bgColor(0xe1e1e1);

Style a single component with custom Unit

Label myLabel = new Label("Test Label");
new Helper(myLabel, , Style.UNIT_TYPE_PIXELS).pa1().ma0().textGreen().bgColor(0xe1e1e1);

Apply same style to multiple unrelated components, individual styles could still be applied

Button myButton = new Button("Test Button 1");
Label myLabel = new Label("Test Label");
SpanLabel mySpanLabel = new SpanLabel("Test SpanLabel");
new Helper(myButton, myLabel, mySpanLabel.getComponentAt(1)).pa1().ma0().textGreen().bgColor(0xe1e1e1);

Contribution

You are welcome to add more styling. Fork the project and commit your code. You can also improve the documentation, methods and classes used.

About

An Helper class for basic styling in Codename One, which provides an alternative to having endless UDIDs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages