Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

inderjsingh
Copy link
Contributor

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

WhatsApp.Video.2025-03-24.at.11.33.41_669ccc8f.mp4

@inderjsingh
Copy link
Contributor Author

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

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.

Feature: Flip to Snooze
1 participant