FocusApp Timer Feature - ChrispyPeaches/FocusFriends GitHub Wiki
Overview
The timer allows the user to set timers for focus and break sessions.
Timer Helper
App Lifecycle Events
Whenever the app is minimized the timer will remember the time that the app was closed, and when the app is resumed, the timer will account for the time between these events.
Focus & Break States
The timer switches between focus mode and break mode.
- While the app is open either in the foreground or background, it will remember the duration of the user's last focus and break sessions and reset the timer to those durations when switching to those states.
User Session Tracking
- Whenever a focus session is completed, if the user is logged in, it'll track the session on the API and the mobile database.
Currency Earned
Currently the rate of currency is 1 coin / minute
Island & Pet Display
The timer screen offers motivation with a pet and an island, this shows the user's currently selected pet and island through an IslandDisplayView control.
Manual Testing Checks
Functionality
- The timer counts down in 1-second decrements
- The timer is adjustable in 1-minute steps by clicking the stepper buttons
- The timer can be adjusted by holding down the stepper buttons
- The buttons (not including tabs) are hidden on the timer screen when the timer is counting down
State Transitions
Focus Session
When a focus timer is stopped
- The timer duration is reset to the duration of the last focus session
- The app allows the user to start focusing
When a focus timer completes
- The timer duration is reset to the duration of the last break session
- The app allows the user to take a break
Break Session
When a break timer is skipped
- The timer duration is reset to the duration of the last focus session
- The app allows the user to start focusing
When a break timer completes
- The timer duration is reset to the duration of the last focus session
- The app allows the user to start focusing
Island & Pet Display
- Default island is shown
- Default pet is shown on island