With the new option to add buttons to Pickers, I just realized there is a little thing missing in the Pickers: you cannot programmatically update the internal value based on the current selections in the scroll wheels. This is only done when the user presses Done.
This is an issue when a user modifies the scroll wheels manually and then press a custom button like "+7 days." The 7 days will then be added to the original internal value that eg getDate() returns and not to the value visible in the scroll wheels.
So, some method is needed for this, either (this could work for the custom buttons) an option to get value corresponding to the current position of the scroll wheels instead of the internal value (say, getPickerValue()) or a method to update the internal value based on the picker positions. I guess the first would be the cleanest and could also be used internally.
With the new option to add buttons to Pickers, I just realized there is a little thing missing in the Pickers: you cannot programmatically update the internal value based on the current selections in the scroll wheels. This is only done when the user presses Done.
This is an issue when a user modifies the scroll wheels manually and then press a custom button like "+7 days." The 7 days will then be added to the original internal value that eg
getDate()returns and not to the value visible in the scroll wheels.So, some method is needed for this, either (this could work for the custom buttons) an option to get value corresponding to the current position of the scroll wheels instead of the internal
value(say,getPickerValue()) or a method to update the internalvaluebased on the picker positions. I guess the first would be the cleanest and could also be used internally.