Code Monkey home page Code Monkey logo

Comments (5)

subbramanil avatar subbramanil commented on July 18, 2024 1

@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.

from simpletodo.

Jizzu avatar Jizzu commented on July 18, 2024

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 :)

from simpletodo.

subbramanil avatar subbramanil commented on July 18, 2024

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.

from simpletodo.

subbramanil avatar subbramanil commented on July 18, 2024

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.

from simpletodo.

subbramanil avatar subbramanil commented on July 18, 2024

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.

from simpletodo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.