public static int getRotationOffset() {
        switch (WindowManagerHolder.WINDOW_MANAGER.getDefaultDisplay().getRotation()) {
            case Surface.ROTATION_0:
                return 0;
            case Surface.ROTATION_90:
                return 90;
            case Surface.ROTATION_180:
                return 180;
            case Surface.ROTATION_270:
                return 270;
            default:
                return 0;
        }
    }
Normalize an angle so that it belongs to the [0, 360[ range.

@param angle the angle in degrees
@return the same angle in the [0, 360[ range
main/src/main/java/cgeo/geocaching/utils/AngleUtils.java