timer-machine / timer-machine-android

⏲ A highly customizable interval timer app for Android
GNU General Public License v3.0
210 stars 18 forks source link

Paused time is included in total time #28

Closed model-map closed 1 year ago

model-map commented 1 year ago

Say I have a timer for 10 second and I pause it for 10 seconds midway before resuming then in Records Total running time would be shown as 20seconds instead of only 10 seconds of the timer time that should be included.

DeweyReed commented 1 year ago

It's expected, at least for the current app. The record shows the overall time from the timer's start to the end.

model-map commented 1 year ago

Why? If I have a timer named "Study" for 2hrs. And for whatever reason I have to take a one hour unplanned break in between the Overall time under "Study" would be 3hrs. But I didnt study 3hrs. I studied 2 (as I planned) albeit with an unexpected break in between.

If there was a separate "Paused time" checkmark that I could uncheck to see my actual time, it'd make sense. But it makes no sense as it is as it bleeds the "Paused time" into work time.

DeweyReed commented 1 year ago

In your example, the study takes three hours from the beginning to the end. The app doesn't and can't know if any pause is planned or unplanned.

model-map commented 1 year ago

As I see it, if the break was planned I'd include it in the timer itself with a separate notifier. Any pause therefore has to be unplanned and so the timer stops everything in the pause - including counting the timer. Wouldn't you agree? Otherwise what exactly is the added benefit of having a pause button? I feel the pause button has been made redundant this way.

DeweyReed commented 1 year ago

This problem is more of a matter of perspective; in my view, the study takes three hours.

Once a timer starts, every second counts. A pause is a temporary gap in your timeline, but it doesn't mean the event freezes.

You're supposed to finish the event within the duration of a timer, which is the purpose of a precise countdown timer. If you're off to do something, stop the timer. If there's always a gap or a pause in the run, use the "Halt" reminder to resume manually after the planned break. If you're dealing with multiple events, start two timers simultaneously.

Adding detailed data to the record will be a new feature in the future, but the app will keep track of pausing nonetheless.

I'm closing the issue. Feel free to reopen it if you have any more questions.

model-map commented 1 year ago

Well, I hate to converse about this but I can see we would have to agree to disagree.

Anyway, the reason I'm commenting is to ask if you could guide me in the direction where I can made changes to the code to add this functionality myself. I'm a JS developer and have never worked with android stuff so I'm a bit clueless in regards to where to look to make the proper changes. One of the great things about open source code is that the users can make the changes they need themselves and so I'm going to attempt doing the same. Still, would appreciate if you could guide me a bit. Thanks.

I don't think I said it before but the app is great and I have around 300hrs logged into it. It's part of my daily operation and therefore I am a bit incessant on the issue. Again, Thanks!

DeweyReed commented 1 year ago

There's no easy way to exclude paused time from a record. A record created by the app includes the timer's start and end times and nothing else.

You can replace the call with a new calculation that keeps the record's duration the same as the timer, but the start or end time will be wrong.

val now = System.currentTimeMillis()
addTimerStamp.execute(
    TimerStampEntity(
        id = TimerStampEntity.NEW_ID,
        timerId = timerId,
        start = now - (timer?.timer?.getTotalTime() ?: 0),
        end = now
    )
)

To build the app, remember to use the main branch and a proper build flavor, as README mentions.

Future improvement on the recording will make the exclusion easier, but I've been swamped in my work and life recently.

model-map commented 1 year ago

Okay, thanks Dewey. It's still a bit confusing to me (Having never developed an Android app). When I am successful I'll let you know. Thanks!