Skip to content

hold to dismiss, fixes #20#26

Open
smichel17 wants to merge 1 commit into
trikita:masterfrom
smichel17:longpress-dismiss
Open

hold to dismiss, fixes #20#26
smichel17 wants to merge 1 commit into
trikita:masterfrom
smichel17:longpress-dismiss

Conversation

@smichel17
Copy link
Copy Markdown

@smichel17 smichel17 commented Dec 27, 2019

Scratching my own longstanding itch in #20

The current implementation is: After 3 seconds of pressing down on the screen, the alarm is dismissed. During those 3 seconds, the background fades from the default to the accent color (same as the alarm icon). If you release early, it will return to the original color. This all works pretty well and is intuitive.
Described in the commit message, very similar to that^.

So, why is this PR still a work in progress? Well, currently it is not well-communicated that you need to hold down in order to dismiss the alarm. Once you start holding, it's obvious how long you need to hold (until the alarm icon disappears), but just tapping doesn't give any indication that you need to do more.

The easy way out is just showing a toast. But I feel like there's probably a better way. I tried changing the alarm icon to a number counting down, but for some reason numbers (and lowercase letters) don't render at all (try replacing "\ue857" with "3" or "s", or "S3" for full weirdness demonstration).
No longer relevant since I'm using an icon.

This is also why I haven't changed the instant-dismiss from hitting the back button or otherwise leaving the app; those are also useful escape valves. (On second thought, given that, maybe this PR is mergeable).

@smichel17
Copy link
Copy Markdown
Author

smichel17 commented Jan 9, 2020

Updated so if you release early, the alarm icon is replaced with the text "HOLD". I think this is now good enough to merge, although I'd still prefer a countdown, if you know how to fix the issue with numbers not appearing. I'm also not sure how that issue will affect translations.

@smichel17 smichel17 changed the title WIP: hold to dismiss hold to dismiss, fixes #20 Jan 9, 2020
@smichel17
Copy link
Copy Markdown
Author

(I also reduced the length from 3 to 2.5 seconds, because that feels like the right amount of time based on my experience in the last 2 weeks)

@smichel17
Copy link
Copy Markdown
Author

smichel17 commented Feb 5, 2020

With another few weeks of use:

  • This is works great and is absolutely merge-able, in my opinion.
  • Lowered the duration again, to 2s.
  • There is one rare circumstance in which it bugs out: sometimes the screen does not turn on before the alarm starts, and then the animation does not play properly. I am not 100% sure what the problem is because I'm usually tired at the time when I would have to debug this :P. However, it's no buggier than when the same thing happens without this patch.
    • Edit: this has happened maybe twice in the two months since I made the change. Very rare.

@smichel17 smichel17 force-pushed the longpress-dismiss branch 2 times, most recently from 13f3a66 to e7f2451 Compare February 16, 2020 15:35
@smichel17
Copy link
Copy Markdown
Author

smichel17 commented Feb 16, 2020

Squashed my commits and changed to a slightly different approach of indicating that you need to hold. Uses an icon instead of the text, to avoid translation issues (only 4-5 letters would fit, and there was the lowercase issue). The details are in the commit message.

Also reduced the duration again, to 2 seconds.

I now have no more niggles at all about this and it's 100% merge-able.

@smichel17 smichel17 requested a review from zserge February 16, 2020 15:49
Instead of dismissing instantly on touch, instead the touch must be held
down for 2 seconds. During this time, the background will fade to be the
same color as the alarm icon, giving a progress indicator.

While holding, the icon will also change to a finger (touch_app), to
provide a hint about what you need to do. This is an effective hint
because tapping makes it flicker, and if you hold for long enough to see
what the new icon is, you'll also hold for long enough that the
background will start fading, giving you the next hint.

Pressing the home or back button will still dismiss instantly, since
there's no way to track touches on those.
@smichel17 smichel17 force-pushed the longpress-dismiss branch 3 times, most recently from 0e40ffb to b28a85c Compare February 16, 2020 16:00
@smichel17
Copy link
Copy Markdown
Author

smichel17 commented Feb 16, 2020

(apologies for a couple force pushes in a row, there was an import I thought I could remove but didn't check, so then had to re-add it)

@xeruf
Copy link
Copy Markdown

xeruf commented May 25, 2020

I built an APK including this fix and some more config options :)
https://github.com/xerus2000/talalarmo/releases/tag/4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants