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.71k stars 408 forks source link

On iOS, a Picker of type PICKER_TYPE_DURATION does allow selecting a zero duration #3065

Closed ThomasH99 closed 4 years ago

ThomasH99 commented 4 years ago

I just noticed that on iOS (iPhone Xr, 13.3.1) a Picker with type PICKER_TYPE_DURATION does NOT allow selecting a duration of 0 hours 0 minutes.

I'm guessing this could be related to using a native time-of-day picker, but a duration must be able to be zero, so it is a blocking bug.

(You can select other combinations like 0 hours 1 min, or 1 hour 0 min or 23 hours 0 min)

I haven't tested this on Android.

ThomasH99 commented 4 years ago

Did you have a chance to look at this? I noticed that on iOS, the Duration picker goes up to 23h59, whereas in the simulator the hours seems to have no upper limit.

codenameone commented 4 years ago

I doubt this is something we'll fix. Native pickers are problematic and are inherently platform specific. I suggest using the lightweight picker for cross platform consistency.

ThomasH99 commented 4 years ago

I just googled and iOS has a duration picker mode, so maybe it was simply not activated in your code?

https://developer.apple.com/documentation/uikit/uidatepicker: “Setting the datePickerMode property to UIDatePicker.Mode.countDownTimer allows the user to choose a duration in hours and minutes. ”

ThomasH99 commented 4 years ago

Did you have the chance to look at this?

ThomasH99 commented 4 years ago

Sorry to keep insisting, but though this problem looks small, it is a real functional blocker since there is no way to justify to a user that he cannot change a duration back to zero.

And using the light-weight picker just for this picker would create an inconsistent UX.

codenameone commented 4 years ago

The lightweight picker solves this. Just set the picker mode to lightweight and it will work consistently on all platforms.

ThomasH99 commented 4 years ago

Sorry to get back to this, but it bothers me that instead of fixing a real functional bug found by one of your users (and probably quite easy to fix) you recommend to use the light weight picker as a work-around which creates an inconsistent UI (since I already use the native date pickers).

I also got the impression is this other discussion on SO How to create a pop-up with a Picker where the picker is immediately active...] ( that the lightweight pickers may not be a very good solution either (you wrote "the component is a bit simplistic. On Android it should behave completely different so we need some more code that knows how to do all of that and that might require a major abstraction/refactoring to seamlessly switch these UI elements").

So, I'm hoping you would reconsider once again fixing this bug?

codenameone commented 4 years ago

Native pickers are BY FAR the worse part to support in Codename One. They broke consistently with every iOS release. EVERY iOS release. Rewriting them from scratch was very hard and that's easier than dealing with that piece of ....