Fork us on GitHub

Updates and Holidays

We'll have a short downtime in the push infrastructure for server updates
Updates and Holidays

Updates and Holidays

Before I go into the details a quick announcement, we need to update some of our push servers. We will have a short amount of downtime on Sunday December 3rd around 8AM GMT. This update should be very fast and barely noticeable but it might impact some push message deliverability for a short period.

Some of us will be on vacation around December but I’ll personally still work during the month. However, I won’t post regular blog updates until mid January as the traffic during the Christmas/new year season is relatively low and I’m afraid some important updates might slip between the cracks. We do plan to push out a plugin update version 3.8.1 during this time as we have some new features and bug fixes pending.

Steve already did a lot of work on continuous integration/TDD (Test Driven Development) support and Travis CI in particular. We already have a blog post pending but since some of the functionality requires a plugin update we’ll publish that in 2018 when people will actually read the post…​ If you want to get a teaser you can check out this wiki page.

We also pushed in a lot of fixes in the past few weeks and a couple of new features…​

South Component

One of the common RFE’s in side menu bar is the ability to add a component to the "south" part of the side menu. Up until now we had various patches and workarounds to allow this but these often required some "dubious" hacks.

We now have a new API that works with the on-top and permanent side menu:

toolbar.setComponentToSideMenuSouth(myComponent);

This places the component below the side menu bar. Notice that this component controls its entire UIID and is separate from the SideNavigationPanel UIID so if you set that component you might want to place it within a container that has the SideNavigationPanel UIID so it will blend with the rest of the UI.

Unit Tests in the Core

We moved the unit tests for Codename One from Steve’s repo to the Codename One repo. You can see most of the unit test code here we hope to add more extensive tests as we run into regressions and implement new functionality.

Default Gap

The Label component might have been one of our mistakes when designing Codename One. It embeds too much functionality into a single component with the icon and the text. If I would start Codename One over again I’d separate the image and text functionality and use a layout/container approach.

Case in point: the gap between the label text and the icon. This defaults to 2 pixels and very few people know how to change it (it’s with the setGap method).

Two pixels is ridiculous for most cases and really hard to customize. We can/should fix this in the themes but I’m afraid this might break a lot of "working" code.

We added a theme constant labelGap which is a floating point value you can specify in millimeters that will allow you to determine the default gap for a label. We also added the method Label.setDefaultGap(int) which determines the default gap in pixels.

I’m conflicted about the right way to "fix this":

  • Set the default gap to 1mm in the Label class

  • Set the theme constant to 1 or 2mm in the native themes

  • Change the default template to the project to include Label.setDefaultGap(convertToPixels(1));

I’m very much inclined to do the 1st option but I’m concerned about compatibility which is why the last option is interesting too. I’m not too crazy about littering our hello world application with hacks though.

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.