Skip to content

Conversation

@gladiuscode
Copy link
Owner

@gladiuscode gladiuscode commented Nov 16, 2025

This PR fixes #90

Summary by CodeRabbit

  • Bug Fixes
    • Improved device orientation detection to more accurately handle edge cases when orientation state is ambiguous, ensuring more reliable and consistent app behavior during screen transitions.

@gladiuscode gladiuscode self-assigned this Nov 16, 2025
@gladiuscode gladiuscode added bug Something isn't working Android Android only labels Nov 16, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 16, 2025

Walkthrough

The PR modifies the default fallback behavior in the convertToDeviceOrientationFrom utility function, changing the return value from Orientation.PORTRAIT to Orientation.UNKNOWN when no specific orientation conditions match during device orientation detection.

Changes

Cohort / File(s) Summary
Orientation Fallback Behavior
android/src/main/java/com/orientationdirector/implementation/Utils.kt
Changed default case in convertToDeviceOrientationFrom to return Orientation.UNKNOWN instead of Orientation.PORTRAIT

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 When sensors spin without a clear direction,
We hop toward UNKNOWN with fresh reflection,
No false PORTRAIT when paths don't align,
Just honest ambiguity—and that's just fine! 🧭

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(android): portrait falsy report when degrees don't match clauses' directly addresses the main change: fixing incorrect default behavior where PORTRAIT was returned instead of UNKNOWN when orientation degrees don't match any conditions.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/90-bug-false-alarm-of-the-listener-when-turning-the-phone-from-landscape-to-faceup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gladiuscode gladiuscode merged commit b6a27da into main Nov 16, 2025
6 checks passed
@gladiuscode gladiuscode deleted the fix/90-bug-false-alarm-of-the-listener-when-turning-the-phone-from-landscape-to-faceup branch November 16, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android Android only bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] False alarm of the listener when turning the phone from landscape to faceUp

2 participants