Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Feature/mark tasks as done #38

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

subbramanil
Copy link

@subbramanil subbramanil commented Jan 10, 2020

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. Added a 'checkbox' to each task -> It is the simplest way to mark a task 'done/not done'
  2. Created a new screen to show the completed tasks in a separate screen -> Again, it's the most straightforward implementation.
  3. Added a 'rounded checkbox' icon to the menu to launch the completed tasks screen.
  4. 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. 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. 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. 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. Updated the view models to accommodate the new feature
  2. Added migration strategies to update the database & schema.
  3. Updated some of the libraries & tools to their latest versions.
  4. Took care of adding the proper translations to the new phrases with the help of Google Translate.
  5. Attempted to add a few test cases but didn't get enough time to finish them.

I 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. 😝

Demo


This change is Reviewable

- Adds new Task Layout using constraint layout to show Tasks with checkbox
- Adds event listener checkbox to 'update' task status
- Updates the migration strategy
- Updates the Task Constructor and it's references to reflect the task
  status boolean flag
- Adds temporary approach to delete task on completion
- Adds Android JUnit Test Libraries
- Adds Basic Unit Test cases for save & update
- Removes unnecessary migration strategy
- Adds a method to get all the open tasks
- Adds a method to get all the open tasks live data
- Updates the database query to fetch tasks that has status as '0'
- Updates the test cases to verify the database operations

BREAKING CHANGE: Introduces a method to get the all the open tasks. i.e., tasks that aren't completed. The app home screen shows the tasks that are open.
- Adds a method to complete the task instead of removing it.

BREAKING CHANGE: On clicking on the checkbox, the task status is updated to '1', i.e., marked as completed instead of deleting from database.
Swiping from either side will continue to delete the task.

This change introduced a bug in the 'Search' screen as the 'Search' screen continue to show all the tasks (open & completed). So when a completed task shown in 'Search Results', unchecking it, may not mark it as 'Not completed'. This is still being worked on.
- Adds a new activity to show the completed tasks
- Adds new option to allow opening the completed tasks view
- Adds string resources for completed tasks labels & related translations
- Fixes the warning in android manifest & adds the new activity definition
- Fixes the warning in menu, i.e., uses 'IfRoom' instead of 'always'

BREAKING CHANGE: This adds a new activity screen that shows the completed tasks that's launched by clicking on a button in the app bar. It only shows the completed tasks.
These tasks can be moved to 'Open/Not completed' stage on clicking the checkbox. It will show up in the main tasks screen as not completed.
- Adds a Task Completion Listener in SearchActivity
- Adds a method in SearchTaskModel to update tasks
- Updates Task Completion Listener in MainActivity

**Note**: The bug was introduced when checkboxes were added & SearchActivity doesn't have a Task Completion Listener. Any action performed in the Search Activity, updated the items in MainActivity since the recycler adapter used the Task Completion Listener in the MainActivity. This has been fixed by adding a separate Task Completion Listener for Search Activity.
- Updates the swipe actions to 'Swipe from Left to Right: Complete the task', 'Swipe from Right to Left: Delete the task'
- Fixes the bug when 'undo'ing a completed task by changing the status before saving it
- Adds swipe feature to completed tasks screen
- Adds the snackbar with 'undo' actions
- Removes unnecessary toast

BREAKING CHANGE: The swipe feature is added to completed tasks screen to help the user clean up the tasks. The swipe feauture is in consistent with the main tasks screen with one exception. Swiping from left to right moves the task from 'Completed' to 'Open' status. Swiping from 'Right' to 'Left' deletes the task as similar to Main Tasks Screen.
@sandorex
Copy link

sandorex commented Jun 8, 2020

Hello, it seems the development has stopped, will you make your branch a new fork so we could get some of those sweet new features?
Also wishlist feature to add tasks on top instead of the bottom

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

Successfully merging this pull request may close these issues.

2 participants