Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

US 01.07.01 View current day's Habits - 5 pts #7

Closed
cbebe opened this issue Oct 2, 2021 · 0 comments · Fixed by #39
Closed

US 01.07.01 View current day's Habits - 5 pts #7

cbebe opened this issue Oct 2, 2021 · 0 comments · Fixed by #39
Assignees
Milestone

Comments

@cbebe
Copy link
Contributor

cbebe commented Oct 2, 2021

As a doer, I want to see what habits I need to do today.

Rationale - Removes any unneeded information (habits that don't need to be pursued at the current day) from the user's view.

Story Points - 5

Risk Level - Medium

Details - Same list as all habits, just add a filter depending on the current day.

  • Copy TodaysHabitsFragment class to HabitsListFragment (or all habits fragment) class.
  • Make TodaysHabitsFragment extend HabitsListFragment and override method for updating the UI.
// For All Habits
@Override
public void onStart() {
    super.onStart();
    mHabitViewModel.getAllHabits().observe(this, list -> {
        // need to cast List<HabitEntity> to List<Habit>
        List<Habit> habits = new ArrayList<>(list);
        adapter.submitList(habits);
    });
}
// For Today's Habits
@Override
public void onStart() {
    super.onStart();
    mHabitViewModel.getAllHabits().observe(this, list -> {
        // need to cast List<HabitEntity> to List<Habit>
        List<Habit> habits = new ArrayList<>();
        for (HabitEntity h : list) {
            // method can be implemented in this fragment or in the `Habit` interface
            if (h.isTodaysHabit(today)) {
                habits.add(h);
            }
        }
        adapter.submitList(habits);
    });
}

Blocked by #2.

To be released at halfway checkpoint.

@cbebe cbebe added this to the Sprint 1 milestone Oct 16, 2021
@cbebe cbebe changed the title US 01.07.01 View current day's Habits US 01.07.01 View current day's Habits - 5 pts Oct 19, 2021
mosaicthej added a commit that referenced this issue Oct 25, 2021
- Make Habit.isInDay() in Habit.java
- Implement the checkBox feature in TodayHabitsFragment.java

Closes #7
@cbebe cbebe closed this as completed in #39 Oct 25, 2021
cbebe pushed a commit that referenced this issue Oct 25, 2021
View current day's Habits

- Make Habit.isInDay() in Habit.java
- Implement the checkBox feature in TodayHabitsFragment.java

Closes #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants