ultimate_alarm_clock icon indicating copy to clipboard operation
ultimate_alarm_clock copied to clipboard

Fix flip-to-snooze functionality to handle initial device orientation

Open inderjeet20 opened this issue 10 months ago • 1 comments

Description

This PR fixes the flip-to-snooze feature that wasn't working correctly. The main issues addressed:

  1. Added proper initial device orientation detection to prevent false triggers when the device is already face down when the alarm starts
  2. Improved the flip gesture detection logic with better state tracking
  3. Implemented a fixed 1-minute snooze duration specifically for flip gestures
  4. Added proper null handling for timers to prevent potential crashes

Fixes #688

The implementation now correctly:

  • Detects when the user flips the phone face down
  • Only triggers snooze when the device transitions from face up to face down
  • Ignores false triggers if the device is already face down when the alarm activates

Testing:

  • Tested with device initially face up → flip to face down: correctly snoozes for 1 minute
  • Tested with device initially face down: correctly waits until device is turned face up before detecting flips
  • Verified compatibility with guardian timer functionality

Screenshots

https://github.com/user-attachments/assets/f4071a8e-3553-43ac-9a75-c5e3cef77462

inderjeet20 avatar Mar 24 '25 06:03 inderjeet20

@MarkisDev and @NishantSinghal19 can you please review this PR.

inderjeet20 avatar Apr 06 '25 04:04 inderjeet20