From 7cc255e53880d3b3933e99ac4b943967dea90844 Mon Sep 17 00:00:00 2001 From: Vasily Laushkin Date: Sat, 30 Jul 2022 00:29:04 +0300 Subject: [PATCH] skip unknown orientation to fix https://github.com/RedApparat/Fotoapparat/issues/400 --- .../io/fotoapparat/hardware/orientation/RotationListener.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fotoapparat/src/main/java/io/fotoapparat/hardware/orientation/RotationListener.kt b/fotoapparat/src/main/java/io/fotoapparat/hardware/orientation/RotationListener.kt index a566504a..f058a074 100644 --- a/fotoapparat/src/main/java/io/fotoapparat/hardware/orientation/RotationListener.kt +++ b/fotoapparat/src/main/java/io/fotoapparat/hardware/orientation/RotationListener.kt @@ -13,7 +13,7 @@ internal open class RotationListener( lateinit var orientationChanged: (DeviceRotationDegrees) -> Unit override fun onOrientationChanged(orientation: DeviceRotationDegrees) { - if (canDetectOrientation()) { + if (canDetectOrientation() && orientation != ORIENTATION_UNKNOWN) { orientationChanged(orientation) } }