fix issue 1886 and created class TagsDialog

edit: removed old info.

I created a class TagsDialog to handle the tags dialogs. Interesting enough, the problem with the radio buttons doesn't happen anymore. Now they are always red.

Also, the itemlist is now sorted in the TagsDialog class to ensure only tags are sorted. I hope the code is good enough. I've made some tests and I believe it works, but of course, probably needs more testing.
No worries, thanks a lot for getting this patch to use over the weekend
when you're so busy! :)


On Mon, Jun 9, 2014 at 11:53 AM, Bruno Romero de Azevedo <
notifications@github.com> wrote:

> In src/com/ichi2/anki/CardBrowser.java:
>
> > @@ -591,6 +585,61 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
> >          }
> >      }
> >
> > +    private DialogFragment showDialogFragment(int id) {
> > +        DialogFragment dialogFragment = null;
> > +        String tag = null;
> > +        switch(id) {
> > +            case DIALOG_TAGS:
> > +                allTags = mCol.getTags().all().toArray(new String[0]);
> > +
> > +                TagsDialog dialog = com.ichi2.anki.dialogs.TagsDialog.newInstance(
> > +                    TagsDialog.TYPE_FILTER_BY_TAG, new ArrayList<String>(), new ArrayList<String>(mCol.getTags().all()));
> > +                dialog.setTagsDialogListener(new TagsDialogListener() {
> > +                    @Override
> > +                    public void onPositive(List<String> selectedTags, int option) {
>
> Sorry I missed that. It is a bit confusing to me right now, another time
> I'll try to understand it well and fix it if it's not already fixed.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ankidroid/Anki-Android/pull/355/files#r13528459>.
>