From fa4d8f15cb4ed5625ef308048949113987f41f89 Mon Sep 17 00:00:00 2001 From: Vasily Laushkin Date: Sat, 30 Jul 2022 00:42:28 +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) } }