InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.71k stars 925 forks source link

Timer: Remember last timer setting #2013

Open tausen opened 7 months ago

tausen commented 7 months ago

Remember last duration used in Timer app. Reset to zero with long press on start button.

Fixes https://github.com/InfiniTimeOrg/InfiniTime/issues/1991

Tested in InfiniSim and on hardware, seems to work as desired:

InfiniSim_2024-02-11_202413

A few notes to consider:

github-actions[bot] commented 7 months ago

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed
tausen commented 5 months ago

Thanks for the feedback! PR updated accordingly.

Shouldn't the timer be reset to the last settings instead of the last paused value?

After some contemplation I've updated the PR to handle pause and stop differently. This ended up a bit more intrusive, but ultimately for the better IMO :)

I couldn't really find a good way to fit two buttons in the bottom like in the stopwatch app without things getting tight, so I've re-used the hold action on the start/stop/pause button:

InfiniSim_2024-04-28_150611

I also had to nudge configTOTAL_HEAP_SIZE from 40 to 39 with these changes. Unsure whether I did something silly or things were just on the edge before?

tausen commented 5 months ago

Pushed one more commit (to be squashed or discarded) -- this saves the last timer setting as soon as it's changed instead of when the timer expires or is stopped. The user can now enter the timer app, configure it for some duration, exit the app again (for example to read a notification), then go back to the timer app and not have to re-configure it.

thun11o commented 2 months ago

Thanks for this 1st contribution @tausen !

There is no difference between restarting a paused timer and starting a new one, so briefly pausing will also update the suggested new duration

I'm wondering if this would be the expected behavior by the users. Shouldn't the timer be reset to the last settings instead of the last paused value? This is an open question, I'm not really sure about this.

New to this project and just got my first PineTime, I'm super happy with it!

I had a Samsung Watch Active before and it resets to the initial value once the timer expires which to me seems correct.

tausen commented 2 months ago

Thanks for the input, @thun11o, I believe the behavior with my changes should match what you're used to then :) I'm using the timer a few times every day and usually at the same setting +/- a minute and it works quite well :+1:

I've rebased this branch onto the latest main.

tausen commented 2 months ago

I've started work on a version based on https://github.com/InfiniTimeOrg/InfiniTime/pull/1971 over here: https://github.com/tausen/InfiniTime/tree/timer-ringing-memory A few things I'd change before promoting it to a PR, but seems to work well so far. With longer vibration time, count up when done and memory of the last setting, it behaves much like the timers I'm used to from other devices :)