azizkayumov / flashcard-maker-android

Flashcard Maker is an android app that allows you to create and import e-flashcards for convenient, paperless studying.
https://play.google.com/store/apps/details?id=com.piapps.flashcardpro
GNU General Public License v2.0
63 stars 22 forks source link

Deleting the card #21

Closed greyboxgt closed 3 years ago

greyboxgt commented 4 years ago

Currently when the card set is deleted, it is moved to Trash storage. But when an individual card is deleted, it is gone forever. I think it would make sense for the card to go to the trash storage as well so it can be recovered if it is deleted by accident.

azizkayumov commented 4 years ago

I think making a card is so easy, no need to have a separate Trash for them. I would prefer to have 'Undo' operation available for like 4-5 seconds after a card is deleted

greyboxgt commented 4 years ago

Remaking a card with a lot of information on it that was deleted by accident might not a very easy job. And 4-5 seconds might not be enough. I think this should work similar to a Recycle Bin in Windows. Card sets in this case are similar to windows folders and the cards are similar to windows files. Deleting a card set with a bunch of cards to the trash is already implemented in the application. I am not sure with the card set with a bunch of cards should be treated differently than an individual card.

azizkayumov commented 4 years ago

Thank you for the clarification, it seems reasonable to have Trash for deleted cards, working on it..

azizkayumov commented 4 years ago

@greyboxgt do you have any idea how cards are kept in Trash? Should they be displayed alongside sets in Trash? I think it would make it messy: imagine having a bunch of cards and sets together in Trash, you may have a hard time finding the necessary set to put back -> I've tried this locally, I really don't like it as a user.

greyboxgt commented 4 years ago

I think it should mimic the move function you already have, the only difference - Trash is a dedicated storage. All the cards in Trash should be organized inside the appropriate set. No card will be outside a set in Trash.

Let's start with completely empty Trash. You want to delete a Card1 from Set1. The moment you do it, an empty Set1 folder is automatically created in Trash and Card1 is moved to Set1 in Trash. Other cards still stay in the original Set1. Now you decide to delete Card4 from Set1. Because we already have Set1 in Trash, Card4 is moved to Trash\Set1. If you go to Set2 and delete Card3, then Set2 is created in Trash and Card 3 from Set 2 is moved to Trash\Set2.

The only problem I see is that folder names should be unique, otherwise it will no be easy to organize the process.

Alternatively, as an option, you may want to remove Trash feature option altogether from the application and users could rely on move to (Trash) folder that you already implemented instead of deleting. To me it just wouldn't make sense to keep the safe delete feature that is able to safe delete the card set only, but not the individual cards.

azizkayumov commented 4 years ago

Thank you for your detailed response. I think creating a clone of a set would complicate the deletion process. I was thinking of removing the delete button from cards, and place it on top bar (next to Cut/Copy). Then following steps would be required to delete cards:

  1. Select cards
  2. Click on the delete button on top bar
  3. An alert will be displayed to confirm with notice that this action permanently deletes the selected cards.
  4. If users confirm with 'Yes', the selected cards will be deleted permanently.

I think we can prevent unintended deletions in this way. Let me know if you have any thoughts on this.

greyboxgt commented 4 years ago

This will work, but the card is gone forever and you won't have a second chance to recover your card after you confirm the deletion. I can suggest another simplified scenario, if that is possible to implement. There will be an permanent set called something like "Recycle Bin" or "Trash". When a user deletes a card by pressing X in the right top corner, the card is not dumped forever, but is automatically moved to the Trash set regardless of the original set name. The cards deleted from other sets will also be moved to the same Trash set. If the user wants to recover the deleted card (s), he goes inside the Trash set and uses the standard Cut/Copy procedure you already developed to recover the card into original or any other card set. If the user deletes the entire card set with some cards in it, all the cards are automatically moved to the same Trash set and the empty card set is dumped automatically. The Trash storage will be designated for the deleted cards only, not for the empty card sets. The cards will be stored in bulk in the Trash bin, but it is much easier to recover the card than recreate it. As for an empty card set - it is relatively easy to recreate it. And you already have a button to empty the Trash.

azizkayumov commented 3 years ago

With this commit, deleting a card does not delete the card permanently, it moves the card to an "archive" version of its set as you described above. The archive version of any set is just another set, it functions like a normal set.

For example, if we're about to delete Card1 from Set1, then following operations will be called after clicking the delete button:

Technically speaking, normal sets have positive IDs, whereas archive sets are created with negative IDs in database. If Set1 has an ID = 100, then its archive version has an ID = -101. In this way, the set ID of any card can be altered from positive to negative or from negative to positive, so that the card always moves between its original set and archive set.

If a set is to be deleted permanently, "Move to Trash" and "Clear Trash" work for archive sets too.

Let me know if that works for you.

greyboxgt commented 3 years ago

Thank you! Would it be difficult for you after each commit to make the latest apk available for download in this githab? Otherwise I have to wait until Daniel makes the apk for me.

azizkayumov commented 3 years ago

Yes, I can do it, but I think it is better for anyone to install apks from trusted sources (Google Play or building from source code yourself).

greyboxgt commented 3 years ago

I was not able to install the compiler on my computer because the compiler required too much space. I think some people might not have enough knowledge on how to compile the source code into executable binary, but they would be able to provide valuable end user feedback. I know the executable files are often compiled by the main developer (who is a trusted source) and published on Github. I would also be happy to install from Google Play beta area if you want to do it for every commit. I am sure you would have even more feedback from end users.

azizkayumov commented 3 years ago

Thank you for feedback. Yes, I have just released it to open testing, it should be visible in few hours. You may now test the new version by joining the beta on Google Play. Feel free to reopen the issue if something comes up.

greyboxgt commented 3 years ago

Thank you for the update! I was able to install your latest beta version from Google Play, but the trick was that I had to manually uninstall the version I installed earlier from an .apk file.

azizkayumov commented 3 years ago

Since Google Play shows a version with release signatures, the one you had was a debug version with the debug signatures. From now on, I will be releasing the app to Beta on every commit / feature addition.

greyboxgt commented 3 years ago

I like it how now we can move the cards between archive and live sets with just one click! But we seem to have lost the ability to delete some individual cards for good. We can only delete the card sets which is not very convenient. One way to resolve this could be adding the delete option to the checkmark menu - CUT, COPY and DELETE. This way we will have a choice of mass selective deletion of the cards we know we don't want to keep. What do you think?

greyboxgt commented 3 years ago

I am not sure if it makes sense to open a new issue, but currently after starting the checkmark menu count the card rotation icon disappears. It would be very useful to be able to rotate the card before making the checkmark menu selection.

azizkayumov commented 3 years ago

It should be live on Open testing soon, I will be testing it tomorrow and promote to production. Feel free to report any issues.

greyboxgt commented 3 years ago

Works very wel, thank you very much! You may want to replace the words CUT, COPY and DELETE with the appropriate icons. This would be less distracting and more universal.