-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Move Decks with Drag and Drop #16542
base: main
Are you sure you want to change the base?
Conversation
Implemented the reparent function on Decks Used ItemTouchHelper to identify which items are being selected Added notification when enter/exit dragNdrop Added Done button and subtitle message Rewrote Test for reparent Deck Co-authored-by: Beatriz Gavilan <beatrizgavilan@tecnico.ulisboa.pt>
Co-authored-by: Beatriz Gavilan <beatrizgavilan@tecnico.ulisboa.pt>
Message to maintainers, this PR contains strings changes.
Read more about updating strings on the wiki, |
Particularly, I feel that the menu option shouldn't be required. |
We decided to use a menu option as the usual drag and drop action would conflict with the long press action already present. Nonetheless, we are of course open to other ideas to activate this "mode"! |
Thank you for your suggestion! While adding an icon to open the menu on the right is indeed outside the scope of this PR (as it would alter the existing UX), it is a very interesting idea. However, given that the review counts are already displayed on the right, adding an additional button might clutter the UI. |
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
Hi @BrayanDSO, I responded to your concern about the menu option not being required, but it seems it might have been missed. Could you please take a look at my previous response and let me know if you have any further suggestions or if this approach is acceptable? Please do not close this PR, as it is awaiting review from the maintainer. Thank you! |
This comment was marked as outdated.
This comment was marked as outdated.
@BrayanDSO I believe this is still pending |
Sorry, but I can't look at this at the moment. Please disregard any comments that I did if it impedes the PR to move forward. |
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
Purpose / Description
We propose a Move Decks feature using drag and drop, so that we can move decks into and out of other decks on our phones, and not have to use Anki via computer just to do this.
How to use it:
Implements
Approach
We implemented drag and drop based on how Anki Desktop does it, to ensure consistency between both platforms (We also considered using Tasks' approach because of how they do indentation). To implement the "Done button" we replicated the code of the "Add button" already present in AnkiDroid, to avoid changing AnkiDroid's design.
What we did:
Added a new Move Decks option to the Options Menu in the DeckPicker. When clicked, it will enable the "drag and drop mode" and:
pullToSyncWrapper
(to allow dragging down);supportActionBar
subtitle to an informative message and temporarily showing a Snackbar informing the user that they have entered the "Move Decks mode".Added a Floating Done Button, which returns the
DeckPicker
to its normal state.Screenshots and Video
How Has This Been Tested?
To test we used both our phones (Samsung S21 Ultra, Samsung A33) and an emulator.
We refactored an old unit test for
reparent
that was commented and updated it to contain the correct order for decks (based on anki desktop)Learning
To implement this feature we ended up using ItemTouchHelper as it made enabling the movement required to drag and drop very easy. It was also extremely simple to retrieve the element underneath the one being dragged.
As alluded to previously, we tried to look at other apps for inspiration, one that we came across was Tasks. Tasks' way to handle reordering tasks is worth considering as the indent gives the user a better perception on what indent level each task (in our case deck) is.
Collaborator
This feature was co-developed by @powy-e.
Checklist