codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Home Page:https://www.codenameone.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting the minute step for a CN1 Picker of type Display.PICKER_TYPE_DATE_AND_TIME doesn’t work

ThomasH99 opened this issue · comments

Describe the bug
Setting the minute step for a Picker of type Display.PICKER_TYPE_DATE_AND_TIME doesn’t work. Whatever minuteStep you set, it remains with a step of 5 minutes.

Even though 5 minutes is often a good default value, I also need to be able to set a precise time of day.

It works fine for the other pickers (PICKER_TYPE_DURATION, PICKER_TYPE_DURATION_MINUTES).

This is for the CN1 / lightweight pickers. I have lightweightPickerBool:true; in my CSS.

Reproduce: in the test code below, click the second picker and the minutes can only be set with a 5 minute step.

Test code:

Form form1 = new Form("Picker minute steps not working?!", BoxLayout.y());
form1.add(new Label("PICKER_TYPE_DATE_AND_TIME"));
{
Picker picker = new Picker();
picker.setType(Display.PICKER_TYPE_DATE_AND_TIME);
picker.setMinuteStep(5);
form1.add(picker);
}

form1.add(new Label("Step 1 minutes"));
{
Picker picker = new Picker();
picker.setType(Display.PICKER_TYPE_DATE_AND_TIME);
picker.setMinuteStep(1);
form1.add(picker);
}

form1.show();

Fixed. Will be part of next release on Friday.