You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces several changes to enhance the activity
tracking functionality, including the addition of pause/resume
capabilities, updates to the tracking state, and improvements to the
user interface.
### Enhancements to Activity Tracking Functionality:
* Added a new `ActivityBroadcastReceiver` in `AndroidManifest.xml` to
handle pause and stop actions for activity tracking.
* Updated the tracking state to include `isPaused` and `durationMillis`
fields in `TrackingState` and modified the `copyWith` method
accordingly.
[[1]](diffhunk://#diff-202d7e63825d16c2b083b05352b9ccfb46fb57a08232c695758033f3a56df224L9-R23)
[[2]](diffhunk://#diff-202d7e63825d16c2b083b05352b9ccfb46fb57a08232c695758033f3a56df224L29-R41)
* Introduced a `togglePauseTracking` method in `TrackingViewModel` to
handle pausing and resuming of activities, replacing the previous
`pauseTracking` method.
* Modified the `startTimer` and `updateDuration` methods in
`TrackingViewModel` to work with `durationMillis` instead of a string
duration.
### User Interface Improvements:
* Updated `ActiveTracking` widget to display `durationMillis` and handle
paused state, including changes to the pause button icon.
[[1]](diffhunk://#diff-d49adc2b4b389d095be8fde161b0fcba63a3d310f235e93716a2360f5be45da9L12-R23)
[[2]](diffhunk://#diff-d49adc2b4b389d095be8fde161b0fcba63a3d310f235e93716a2360f5be45da9L42-R74)
* Enhanced `TrackingRecording` widget to show the elapsed time and
current speed, considering the paused state.
[[1]](diffhunk://#diff-6321dbec87c91b717c14f686f4ba1bc8f0adb34ea26bce120c9630fd5d3093eeR9-R20)
[[2]](diffhunk://#diff-6321dbec87c91b717c14f686f4ba1bc8f0adb34ea26bce120c9630fd5d3093eeL29-R42)
[[3]](diffhunk://#diff-6321dbec87c91b717c14f686f4ba1bc8f0adb34ea26bce120c9630fd5d3093eeL48-R52)
[[4]](diffhunk://#diff-6321dbec87c91b717c14f686f4ba1bc8f0adb34ea26bce120c9630fd5d3093eeL81-R101)
* Adjusted `TrackingFinished` widget to display the total duration in
milliseconds.
[[1]](diffhunk://#diff-8e932347020831edfb689603f2cd801760565ebfe1a13041289556cf0f781148R14-R26)
[[2]](diffhunk://#diff-8e932347020831edfb689603f2cd801760565ebfe1a13041289556cf0f781148L73-R76)
[[3]](diffhunk://#diff-8e932347020831edfb689603f2cd801760565ebfe1a13041289556cf0f781148L89-R93)
### Code Refactoring:
* Updated various files to replace string duration with `durationMillis`
and to include `isPaused` state where necessary.
[[1]](diffhunk://#diff-70a7a11b1888ccd7f44bd2466497659e9b19eb98003d549efd994b23d5c7f566L50-R50)
[[2]](diffhunk://#diff-70a7a11b1888ccd7f44bd2466497659e9b19eb98003d549efd994b23d5c7f566L172-R177)
[[3]](diffhunk://#diff-e9fe2cd457ace53e850809c195f8fa463087c0b63e124a31541a255b5493a965R58-R67)
[[4]](diffhunk://#diff-2315f9fe656582eb216ac6a4ebc0d82ccd82b493eabba1af6a7bafa63a5475e3R11-R41)
* Simplified event handling in `TrackingViewModel` by using constants
from the `Event` class.
0 commit comments