Kr0oked / Compass

Simple and beautiful compass for Android
GNU General Public License v3.0
314 stars 45 forks source link

Follow screenOrientation #3

Closed Atemu closed 3 years ago

Atemu commented 3 years ago

Apps that don't allow me to re-orient them are one of my pet-peeves and forcing apps to follow screenOrientation anyways through an overlay works in 95/100 cases.

Here, it wasn't as trivial though because changing the orientation rotates the app and therefore the compass. Landscape, inverse portrait and inverse landscape need it to be rotated by -90, -180 and -270 degrees respectively to compensate for this effect.

The implementation is not pretty but it's the best API for that kind of thing I could find.

Btw, gradle wouldn't let me sync initially because distributionSha256Sum being set in the wrapper props; you might want to look into that.

Kr0oked commented 3 years ago

Thanks for your input on the screen orientation. I think a compass app is a special case regarding screen orientation. Because of its nature you tend to rotate your phone around without the intention to trigger an orientation change. But I see that a user should have control over the apps orientation. So I added an option to allow or lock the screens rotation in the latest commit. Regarding the hash sum in the gradle properties, I dont know what went wrong in your sync but the value seems to be correct.