vikramkakkar / SublimePicker

A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.
Apache License 2.0
2.31k stars 407 forks source link

Fix: Options other than 'Custom' are not selectable in 'REPEAT_OPTION… #86

Closed olfek closed 1 year ago

olfek commented 6 years ago

…_PICKER', MORE

This occurs when the following options are set for 'SublimeOptions':

sublimeOptions.setPickerToShow(SublimeOptions.Picker.REPEAT_OPTION_PICKER)
sublimeOptions.setDisplayOptions(SublimeOptions.ACTIVATE_RECURRENCE_PICKER)

Steps to reproduce:

1. Create a sublime picker instance with the options above set.
2. Attempt to click any options other than 'Custom'

Notice that options other than 'Custom' are not selectable.
olfek commented 6 years ago

@vikramkakkar Hi again, could you please take a look at this MR when your free (its a very small change), thanks :)

vikramkakkar commented 6 years ago

Hi @olfek

I'm unable to reproduce this scenario using the sample app.

sublimeOptions.setPickerToShow(SublimeOptions.Picker.REPEAT_OPTION_PICKER) sublimeOptions.setDisplayOptions(SublimeOptions.ACTIVATE_RECURRENCE_PICKER)

  1. Create a sublime picker instance with the options above set.

I deselected DatePicker & TimePicker & launched SublimePicker. I was shown the recurrence picker at this point.

  1. Attempt to click any options other than 'Custom'

I picked option Every Day & the info view in the activity showed Recurrence Option: DAILY, which is correct.

I guess the picker closes right after we choose an option (other than Custom), so we're not able to see the selected value. But the callback is triggered with the correct option.

The sample activity does not update the SublimeOptions on subsequent picker relaunch. But, if we wanted to sort of persist the recurrence option, we could do something like https://github.com/vikramkakkar/SublimePicker/compare/pr/recurrencePickerOptions

I might not be understanding this issue correctly - can you please provide some more info?

olfek commented 6 years ago

I guess the picker closes right after we choose an option (other than Custom), so we're not able to see the selected value. But the callback is triggered with the correct option.

Correct. If you remove the code used to hide the picker after selecting an option, you'll notice that the selection doesn't change even though the correct callback is fired.

With my commit, the selection does changes and reflects what ever option the user chooses. Of course, with the picker being hidden after selection, it doesn't make much sense to accept this MR because the user won't be able to see whether the option is selected or not other than the correct action being taken from the callback that is fired, but consider for a moment the case where the picker needs to stay open even after selection, it is here that the UI fails because the correct feedback is not provided back to the user, the correct feedback here being updating the view to set the users selected option as selected.