Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX Improvements #4

Closed
jscti opened this issue Feb 16, 2024 · 4 comments
Closed

UX Improvements #4

jscti opened this issue Feb 16, 2024 · 4 comments

Comments

@jscti
Copy link

jscti commented Feb 16, 2024

Hi there.

First: your libs are awesome, bravo !

I'm trying to tune the behavior of the List Dialog and have a few remarks :

  • DialogList.SelectionMode.SingleSelect : the whole line should be selectable (not only the radio button)
  • DialogList.SelectionMode.SingleClickAndClose :
    • there is no indication of the current value when dialog is open (and at the same time, it's not very explicit that the lines are clickable). Maybe the Radio button could be shown like in the DialogList.SelectionMode.SingleSelect mode ?
    • the "OK" button looks like a "submit" but not needed as it is a click&close behavior. Maybe it should be hidden in this case ? or replaced by a "cancel" button ?
  • There is a "ok" button but maybe an optional "cancel" button could be usefull to let user explicitely cancel

Well, to sum it all up : I'm switching from legacy PreferenceScreen and I try not to disrupt legacy behavior well summarized by this example (gmail settings) :

image

  • radio button to show current value + explicit "this line is clickable" info to the user
  • auto dismiss on click
  • no "submit/ok" button
  • "cancel" button

Could this be added as a new SingleSelectAndClose maybe ?

Thanks

@MFlisar
Copy link
Owner

MFlisar commented Feb 26, 2024

1) Single Selection Mode

DialogList.SelectionMode.SingleSelect : the whole line should be selectable (not only the radio button)

Please check out selectOnRadioButtonClickOnly in following code:

/**
* single selection mode for the list dialog
*
* @param selected holds the currently selected item id
* @param selectOnRadioButtonClickOnly if true, only clicks on the radio button will select an item, otherwise a click on the item itself will select it as well
*/
class SingleSelect<T>(
val selected: MutableState<Int?>,
val selectOnRadioButtonClickOnly: Boolean = true
) : SelectionMode<T>()

2) Single Click and Close Mode

This mode is just a click mode without indicators.

3) Buttons

Buttons are common for all dialogs, there is no special behaviour for lists. So simply adjust them to your needs manually. Following is part of every dialog:

Every dialog does support an ok and/or cancel button or even none, simply set it up yourself.

Adjustments I'll make in the next update:

I will add an closeOnSelectionChanged boolean to the SingleSelect class which will allow you to use the single select mode like the click and close mode. This in combination with all the information above should solve all your problems.

@jscti
Copy link
Author

jscti commented Feb 26, 2024

Thanks for your details and the new closeOnSelectionChanged 👍

And it's already coded and released !
And tested, that's perfect.

@jscti jscti closed this as completed Feb 26, 2024
@jscti
Copy link
Author

jscti commented Mar 30, 2024

@MFlisar

Actually maybe the new closeOnSelectionChanged should have been a closeOnSelection even if the selection did'nt change.
Because a user reopening just to check/confirm its selection will :

  • tap value to reconfirm it
  • nothing happens
  • must hit bottom "cancel" button or dismiss modal by clicking elsewhere

which is not optimal, a tap on a already selected value should just close the dialog like when he chooses another value.

@jscti jscti reopened this Mar 30, 2024
@MFlisar
Copy link
Owner

MFlisar commented Mar 30, 2024

that makes sense for this special mode, so I changed it

@MFlisar MFlisar closed this as completed Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants