ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.4k stars 2.18k forks source link

Import multiple files #10641

Closed PanderMusubi closed 2 years ago

PanderMusubi commented 2 years ago

Is your feature request related to a problem? Please describe. When importing multiple files, I have to import them one by one. This means also resorting the file browser even though I use the same directory and for several files, this takes unneeded a lot of time extra..

Describe the solution you'd like When selecting a file to import, allow selecting multiple files.

Describe alternatives you've considered n/a

Additional context n/a

david-allison commented 2 years ago

In the meantime, you should be able to open the files using your file explorer, rather than the AnkiDroid import dialog - this should be slightly faster

n1snt commented 2 years ago

Can I try to implement this feature?

david-allison commented 2 years ago

Sure

PanderMusubi commented 2 years ago

Would importing all decks for a given directory also be a feature request (here or in another issue)?

Would be an extra menu item called Import directory... and the current import menu item be called Import file(s)...

mikehardy commented 2 years ago

I think standard user experience for "multi-select" is that for pickers that allow multi-select, there is a toggle for select all / unselect all, along with the checkboxes next to each selection entry, and nowadays it appears Android also lets you select a range of entries via a long-hold drag gesture or something.

Which is to say: probably best to use some sort of existing system multi-select widget if possible, or open the file picker in multi-select mode if that's a thing.

n1snt commented 2 years ago

I have completed implimenting selection of multiple files And showing multiple files in importing dialog. Can I please get some ideas on how I can make this dialog look pretty? I'm thinking of some kind of list to display filenames.

Edit: Added progress

n1snt commented 2 years ago

How does this look?

n1snt commented 2 years ago

Now I'm implementing the Dialog which gets displayed once the files are imported. I have currently made it work to look something like this: image

n1snt commented 2 years ago

I am also working on file import progress to add some indicator which file is being imported, this is a mockup of how I wish the file progress to be: newImportFile

mikehardy commented 2 years ago

Oh I hadn't contemplated progress reporting. This is a pretty complicated feature! I like the idea of an 'N of Y' (or N/Y) display, and keeping it separate from the % lines that are per-file since it won't be easy to aggregate across all files for full percentages

In other words, either something like you just mocked up here, or if it's hard to change the dialog title but easy to change contents, add a line without the dot that contains the File N / Y.

I do think we have an existing pattern of saying "N of Y" vs "N/Y" but I don't feel that strongly. It will need to be a format string though with two formats ($1%d and $2%d - or at least I think I got the % and $ right, maybe I switched them - there are examples) in order to handle RTL langauges)

n1snt commented 2 years ago

@mikehardy this issue should be closed as #10851 was merged.

david-allison commented 2 years ago

@n1snt Before we do this, what about the follow-up issues as mentioned in https://github.com/ankidroid/Anki-Android/pull/10851#pullrequestreview-967928674

n1snt commented 2 years ago

I have already made a PR for that #11303

david-allison commented 2 years ago

If that was the only follow-up then great!