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.
https://www.codenameone.com/
Other
1.7k stars 403 forks source link

Duration picker bugs #2839

Open jsfan3 opened 5 years ago

jsfan3 commented 5 years ago

I noted three issues in the current implementation of the duration picker (regardless of the RFE https://github.com/codenameone/CodenameOne/issues/2832).

Test case, tested on iOS:

Form hi = new Form("Test case duration picker", BoxLayout.y());

        Picker nativeDurationPicker = new Picker();
        nativeDurationPicker.setUseLightweightPopup(false);
        nativeDurationPicker.setType(Display.PICKER_TYPE_DURATION);
        hi.addAll(new Label("Native duration picker"), nativeDurationPicker);

        Picker lightweightDurationPicker = new Picker();
        lightweightDurationPicker.setUseLightweightPopup(true);
        lightweightDurationPicker.setType(Display.PICKER_TYPE_DURATION);
        hi.addAll(new Label("Lightweight duration picker"), lightweightDurationPicker);

        hi.show();

Screenshot of the native picker Issue 1: it doesn't allow to select 0h 0m, while the lightweight picker allows it Issue 2: it doesn't allow to select a duration that is not a multiple of 5m, for example 3m 2E8F7911-AF2A-4216-A389-46B22FDD1492

Screenshot of the lightweight picker Issue 3: it doesn't allow to select 0h 59m 0C5C794E-6502-4F4B-BA6D-0C89386F6963

Thank you for your support

jsfan3 commented 5 years ago

About the issue 2 (selecting a duration that is not a multiple of 5m on an iOS native picker) the solution is to use the API https://www.codenameone.com/javadoc/com/codename1/ui/spinner/Picker.html#setMinuteStep-int- I didn't noted that.