AEFeinstein / mtg-familiar

An Android app for all things Magic: The Gathering
Other
280 stars 72 forks source link

Sort Sets Alphabetically #98

Closed AEFeinstein closed 7 years ago

AEFeinstein commented 9 years ago

Currently sets are sorted by release date. It would be nice to be able to change the sorting order of the dialog to alphabetical, from within the dialog.

karaken12 commented 9 years ago

I'm not sure this is really worthwhile, at least from within the dialog. What is the use case? If I'm looking for a specific set, say "Visions", do I really want to have to scroll through to find the right part? I think it would be better to keep it as it is, but include a search box in the dialog. I've written that up as a request at Issue #100 .

AEFeinstein commented 9 years ago

Yes, the use is for people to find a set alphabetically rather than chronologically. The list isn't so large, only 100ish elements. I can look at adding a fast scroller to the dialog, but I'm not sure how possible that is with the system's default list dialog.

MarcelBucz commented 7 years ago

Hi, Sometimes I want to have a look at, say, the rares of the invasion block. I consider scrolling down somewhere halfway and selecting the checkboxes over there not very user friendly and it will get worse with every release. Instead of selecting the sets from the dialog, it would also be possible to have a autocomplete text box, analogous to the subtype text box. Here are a few screenshots from my prototype (of course; the text box can also be implemented in a separate dialog, and adding the expansion symbols would look really cool I suppose). What do you think?

image image image image image

AEFeinstein commented 7 years ago

Hm, that's an interesting prototype.

Things I like:

Things I don't like:

Is there a way to order the autocomplete entries by date instead of alphabetically and match on 0-length input? That way if the user selects the EditText, they see a chronological list of sets in the dropdown. The user can then either tap a chronologically recent set or type for an older one.

MarcelBucz commented 7 years ago

Thank you for your input, sorting the sets on date is not an issue as I sorted them alphabetically on purpose, I agree it makes more sense to have it sorted on date. The matching on 0-length input is also possible, but I'm not happy with the various workarounds proposed on stackoverflow. Instead I prefer to have a button next to the autocomplete that expands the dropdown onclick. Now the chosen sets are also removed from the dropdown, next up is adding the chosen sets back to the dropdown when they are removed from the autocomplete.

AEFeinstein commented 7 years ago

The suggestions for 0-length input here don't seem so bad. What don't you like about extending AutoCompleteTextView and overriding enoughToFilter()?

It may be easier to not bother adding or removing entries from the autocomplete options. Instead, you could scan the input after a new set is added and remove duplicates. Or just leave the duplicates, they don't break the SQL logic. Besides, would your code remove Kaladesh from the autocomplete list if the user typed KLD instead of selecting the autocomplete entry?

MarcelBucz commented 7 years ago

What I didn't like is that the dropdown is hidden after you choose the first item. Going from there, you still need to type to show the list, the suggested workaround is therefore only for AutoCompleteTextView. Below some screenshots from the version with the button to expand the dropdown (wrong icon, I know...). Regarding the adding/removing entries; no it wouldn't remove KLD from the list. It's not that advanced (yet).

image

onclick image

AEFeinstein commented 7 years ago

Take a look at this library: https://github.com/splitwise/TokenAutoComplete I think it looks pretty and it solves some of the problems like automatically filtering duplicates.

You can stick with the extra button for now. If I figure out a way to keep the list open after an item is selected, that will replace the button.

Also, I don't know where you're developing the code, but you should fork the project and periodically commit your changes. When the feature is done, you can submit a pull request so that it gets merged back into the master project.

MarcelBucz commented 7 years ago

That library looks good; I started implementing it and I also found a way to get rid of the extra button. I will commit my changes soon. I'll also try if the TokenAutoComplete fits for the type fields.

AEFeinstein commented 7 years ago

Sounds good. I want to start the release process on April 4th, so try to have it done by then or it'll wait until the next release.

AEFeinstein commented 7 years ago

Merged in #183