Skip to content
This repository has been archived by the owner on Apr 10, 2021. It is now read-only.

Mark tasks as done rather than deleting them? #25

Open
TobiasDev opened this issue Feb 1, 2019 · 5 comments
Open

Mark tasks as done rather than deleting them? #25

TobiasDev opened this issue Feb 1, 2019 · 5 comments

Comments

@TobiasDev
Copy link

Maybe Im the only one. But would it be possible to add that right sweep marks the task as done and left sweep deletes it?

I usually check before I go to bed (hence why I might be the only person in the world wanting this) what I managed to finish during the day and plan for tomorrow by organising my tasks in the order I need to tackle them.

I would also love to see different lists and maybe a bit smaller font. But once again just personal opinons! Love the app and I'm looking forward to the 1.5 release! :)

@subbramanil
Copy link

subbramanil commented May 17, 2019

@Jizzu Have you guys started working on this feature?

I picked up your project as it was interesting and I'm exercising my kotlin/android jetpack features. I have a partially completed code in the below branch.

https://github.com/subbramanil/SimpleToDo/tree/feature/mark_tasks_as_done

It's still Work in Progress. I ran into an issue where the tasks are not inserted into the table. So I'm guessing I may have missed out something. I may spend some more time over the weekend to see if I can fix it.

Also, this feature requires changes to the app that needs more information. So I don't know if you guys had thought about it. If you have, please share. I will see if I can contribute more.

@Jizzu
Copy link
Owner

Jizzu commented May 17, 2019

Hi, @subbramanil ! Thanks for your interest in this project :)

I have not started this feature yet, but if you want, feel free to contribute to the project.
Also, I checked your branch and there are no problems with the database table. I made some minor changes of your code and now everything works fine! Here is the pastebin link with all the changes I made to your code (I allocated the necessary places in the code with the comments): https://pastebin.com/4f1Zva0F

PS: It also seems to me that for the status of the task it's better to use Boolean, not Int :)

@subbramanil
Copy link

Hi @Jizzu

I applied your changes, and it makes more sense. And I also updated the task status from Int to Boolean. Guess, I was equating SQLite data types to Room. I don't think SQLite supported 'Boolean' datatype directly, used to support through integer 0/1.

@subbramanil
Copy link

Hi @Jizzu,

Have you thought about how to handle completed tasks?

Show the completed tasks in a separate screen would be the simplest. But I wanted to know if you had thought about any other design.

@subbramanil
Copy link

Hi @Jizzu

I hope that you are doing great. It's been a while since my last message. As I was cleaning up my works in 2019, I noticed that this is pending. So I spent some time and added the feature.

Without a clear answer to my earlier questions, I took some liberty to design the feature on my own. Below are the changes I made and the design considerations.

  1. I added a 'checkbox' to each task -> It is the simplest way to mark a task 'done/not done'
  2. I created a new screen to show the completed tasks in a separate screen -> Again, it's the most straightforward implementation.
  3. I added a 'rounded checkbox' icon to the menu to launch the completed tasks screen.
  4. I updated the swipe actions in the main tasks screen as follows.

Swipe Left to Right --> Complete the task
Swipe Right to Left --> Delete the task

With having a screen to see the completed tasks, I felt it would be better if I keep the behavior of swiping from Left to Right action similar to the behavior of the checkbox.

  1. I added the option to move a task from 'Completed' to 'Open'(Tasks Home) status by clicking the 'Checkbox' in the 'Completed Tasks' screen -> 'Undo' an incorrectly marked task as 'Completed' is the existing feature. But I felt the user would prefer to have the ability to move from 'Completed' to 'Open' status if the missed the window when the snack bar message is shown.
  2. I added swipe actions to 'Completed Tasks' screen as similar to 'Tasks Home' with the exception of 'Swiping from left to the right moves the task from 'Completed' to 'Open' status. Swiping from right to left would delete the task as usual.
  3. I disabled editing a 'Completed Task' in order to simplify. The completed task can still be edited by moving it to 'Open' and then edit.

In addition,

  1. I have updated the view models to accommodate the new feature
  2. I have added migration strategies to update the database & schema.
  3. I updated some of the libraries & tools to their latest versions.
  4. I also took some care to add the proper translations to the new phrases with help of Google Translate.
  5. I have attempted to add a few test cases but didn't get enough time to finish them.

I have tried to provide enough information in the commit messages. Overall I feel happy about completing the feature, but I may have overstepped my boundaries as a contributor. 😝

I am submitting a PR pretty soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants