eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

Ability to show selected items if Dialog is called second time #43

Closed saintjab closed 6 years ago

saintjab commented 6 years ago

Thanks for this great library, very helpful and saved me time. I was thinking I would be great if there is a way to show selected items in the multi-choice mode especially if the same Dialog is shown for the second time, like if the user already picked some items from the list and then wanted to be sure of the selection or wants to add more items to the selection. Maybe something like

SimpleListDialog.build() .title("Select Categories") .choiceMode(SimpleListDialog.MULTI_CHOICE) .theme(R.style.MyFancyDialogTheme) .choiceMax(5) .items(getActivity(), R.array.activites) .filterable(true)**.preselected(2, 6, 8)** .show(registrationActivity, CATEGORY_DIALOG);

eltos commented 6 years ago

Hey @saintjab, thanks for your feedback. The method you are looking for is actually called choicePreset (for indices) or choiceIdPreset (for ids).
Have a look at the wiki here.

saintjab commented 6 years ago

Sorry, it looks like I didn't read the wikis thoroughly. Thanks for the pointer

eltos commented 6 years ago

No problem :)