ultimate_alarm_clock
ultimate_alarm_clock copied to clipboard
Fix flip-to-snooze functionality to handle initial device orientation
Description
This PR fixes the flip-to-snooze feature that wasn't working correctly. The main issues addressed:
- Added proper initial device orientation detection to prevent false triggers when the device is already face down when the alarm starts
- Improved the flip gesture detection logic with better state tracking
- Implemented a fixed 1-minute snooze duration specifically for flip gestures
- 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
@MarkisDev and @NishantSinghal19 can you please review this PR.