Clock icon indicating copy to clipboard operation
Clock copied to clipboard

Add function to set alarm "--:-- from now"

Open ltguillaume opened this issue 1 year ago • 7 comments

Describe the solution you'd like

There are cases where it would be preferable to not set an alarm by specifying the time directly, but by filling in the amount of hours and minutes from now (or, more specifically, from the moment you press the "OK" button).

Use case

Examples are when you have a washing machine that displays the time remaining or you need to put in x hours of work.

The benefits of setting an alarm compared to setting up a timer are:

  1. You're able to configure a separate ringtone, so you know immediately what's going on
  2. You're able to reuse a previous alarm's settings, while being able to change the time
  3. You're able to set a one-time alarm this way, which will be gone after it went off
  4. You'll get a notification that the alarm is set to go off when configured in the settings

Describe alternatives you've considered

Timers have the above drawbacks. To make timers as useful as an alarm with a "From now" feature, it would mean implementing:

  1. The ability to choose a ringtone per timer
  2. The ability to change an existing timer's remaining time
  3. The ability to remove the timer after it went off and was stopped
  4. The ability to add a notification of a timer's status

That's a lot more work than a single change for alarms.

Additional context

This could be implemented by adding to the digital time picker:

  • Long-pressing "OK" to set the alarm "from now"
  • Adding a "FROM NOW" button next to "CANCEL" and "OK"
  • Adding a checkmark/switch above the aforementioned buttons, named "Set the alarm --h--m from now" (dynamically setting -- to the user input)

ltguillaume avatar Nov 19 '24 13:11 ltguillaume

I don't understand the benefits of setting an alarm as you describe:

1. You're able to configure a separate ringtone, so you know immediately what's going on → Already possible in the extended alarm view 2. You're able to reuse a previous alarm's settings → Simply click on the "Duplicate" button 3. You're able to set a one-time alarm this way, which will be gone after it went off → Simply click on the "Delete alarm once dismissed" checkbox 4. You'll get a notification that the alarm is set to go off when configured in the settings → Already possible in the Alarms settings

That's a lot more work than a single change for alarms.

This is not true.

BlackyHawky avatar Nov 21 '24 09:11 BlackyHawky

I meant that implementing all these features for a timer would be a lot more work than implementing only a "From now" feature for alarms.

ltguillaume avatar Nov 21 '24 09:11 ltguillaume

Or did you mean that implementing these 4 features for timers is in fact not more work?

ltguillaume avatar Nov 22 '24 13:11 ltguillaume

From what I understand, in summary, you want to port some functionality from alarms to timers. Is that correct?

I meant that implementing all these features for a timer would be a lot more work than implementing only a "From now" feature for alarms.

What I was saying was that implementing the "From now" feature would also take a lot of work and above all it could generate major unexpected bugs.

BlackyHawky avatar Nov 25 '24 10:11 BlackyHawky

From what I understand, in summary, you want to port some functionality from alarms to timers. Is that correct?

I would prefer the addition of a "From now" button for alarms and proposed the porting of functions to timers only as an alternative solution to reach the same goal.

ltguillaume avatar Nov 25 '24 13:11 ltguillaume

From what you describe, why not just use the timer? I really don't understand the benefit of your request... 🤔

BlackyHawky avatar Nov 25 '24 14:11 BlackyHawky

  1. You cannot set an individual ringtone for a timer: for me, the ringtone of an alarm indicates what the alarm is for
  2. You cannot change the time remaining for existing timers (e.g. when using a different washing program or when you forgot to initiate the timer from the very beginning)
  3. You cannot let timers be removed automatically after they're done
  4. You're not getting a notification for timers x minutes before they run out

Apparently you misunderstood me earlier when I listed these, as you countered these as already possible for alarms. That was exactly my point. They are what I'm missing when trying to set a timer wegen compared to setting an alarm.

The "From now" solution would be a lot less prone to introducing any bugs, because it would immediately show if something went wrong, seeing as it would only set the time of a regular alarm.

At pressing OK it would just take set the alarm for currentTime + hours field + minutes field.

ltguillaume avatar Nov 25 '24 15:11 ltguillaume

That's was Awesome!

We can used the current Timer but add/set a additional time but the default time for the next alarm want don't changed.

Revan335 avatar May 29 '25 06:05 Revan335

There is an alternative that will work properly with future version 2.24:

  • Use the Warpclock application available on F-Droid here.

If you're unable to compile the Clock app yourself, below is the 2.24-beta version, fully compatible with Warpclock.

Clock_2.24-beta-release.zip

BlackyHawky avatar Jun 29 '25 01:06 BlackyHawky

I already tried to use https://f-droid.org/en/packages/net.xisberto.timerpx/ in that way, but it doesn't really allow for the following in a practical way:

1. You cannot set an individual ringtone for a timer: for me, the ringtone of an alarm indicates what the alarm is for It just creates a new alarm with the defaults every time, instead of being able to re-use an existing customized alarm and inputting now + time.

2. You cannot change the time remaining for existing timers (e.g. when using a different washing program or when you forgot to initiate the timer from the very beginning) Also applies to using an external app, but in a slightly different way: you can add a new alarm and then enter Clock and remove the other alarm, but not just change the existing alarm.

ltguillaume avatar Jun 29 '25 01:06 ltguillaume

@ltguillaume Can you please test the apk below?

You'll be able to create an alarm and choose the delay by long-pressing the floating action button, and if you want to modify an existing alarm you need to long-press the alarm time.

Clock_2.24-beta-debug.zip

Edit: Do you think this should be possible by default, or should a setting be created in the Alarms settings? 🤔

BlackyHawky avatar Jul 12 '25 17:07 BlackyHawky

This is already great, and I think the long-press shortcut actually helps in the workflow, too!

I'm guessing this solution is based on the fact that you won't have to customize the library used for the time input?

I'm not exactly a fan those spinners, though, because they always take a lot longer to precisely specify a time. It really feels icky.

In an ideal world, the fastest and easiest way by far to input hours and minutes (be it for this particular case, or a regular alarm/clock time), is this:

  1. Don't have to wait for a keyboard to open
  2. Starts in minutes, so if you type "22", it'll just show --:22 and OK would input 22 minutes from now. (In normal alarm/clock mode, it would need another number to e.g. get to 02:22.
  3. Easy one-key :00 and :30 fill
  4. Easy adjustment buttons to +1 or -1 the hours or minutes directly
  5. Tapping the hours or the minutes would select the current value, so you can overwrite it directly (and in case of hours, it would jump to and select the minutes value after the value 3-9, or 2 + 1-3, or 1 + 1-9 are put in).
  6. Optional AM/PM switch not in screenshot

ltguillaume avatar Jul 12 '25 21:07 ltguillaume

If the feature works as you expect, I consider this issue closed.

Regarding the interface you're suggesting, this will not be implemented because I want to stay close to the other alarm Dialogs to maintain consistency.

Note 1: you can use the keyboard with the spinners by clicking on either the hour or minute field; Note 2: currently, setting an alarm using this feature + using the keyboard takes less than 7 seconds. The hundreds of lines of code to write + the tests to perform to implement your interface in order to save 1 or 2 seconds (without being certain) is not worth it. I hope you understand.

BlackyHawky avatar Jul 12 '25 22:07 BlackyHawky

That is absolutely understandable. As said, "in an ideal world". But the implementation you just presented is really great, thank you so much!

Edit Oops, closed it again. I should have remembered it'll close with the commit 😅

ltguillaume avatar Jul 12 '25 22:07 ltguillaume

I'm reopening this issue because it will automatically close when I publish the commit.

That is absolutely understandable. As said, "in an ideal world". But the implementation you just presented is really great, thank you so much!

Thank you for your understanding.

BlackyHawky avatar Jul 12 '25 23:07 BlackyHawky