From b468b86c638371aaa3b58c935c3516532a81f975 Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:04:58 +0900 Subject: [PATCH 1/2] :wrench: Because deviceMotionActive was being checked in places where deviceMotionAvailable should have been checked, there was a problem where the motion sensor would not work on iOS. --- .../confsched/droidkaigiui/OrientationSensorManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt index 3e81b37db..11c29a062 100644 --- a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt +++ b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt @@ -22,12 +22,12 @@ internal class IosOrientationSensorManager( private val motionManager = CMMotionManager() override fun start() { - if (!motionManager.deviceMotionActive) { + if (!motionManager.deviceMotionAvailable) { return } - NSOperationQueue.currentQueue()?.let { + NSOperationQueue.mainQueue().let { queue -> motionManager.startDeviceMotionUpdatesToQueue( - it, + queue ) { motion, _ -> if (motion == null) { return@startDeviceMotionUpdatesToQueue From 51e9aee7588fbd710f08cfe17ac630793be609fc Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:05:24 +0900 Subject: [PATCH 2/2] :wrench: ./gradlew detekt --auto-correct --- .../confsched/droidkaigiui/OrientationSensorManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt index 11c29a062..55614fdbc 100644 --- a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt +++ b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.kt @@ -27,7 +27,7 @@ internal class IosOrientationSensorManager( } NSOperationQueue.mainQueue().let { queue -> motionManager.startDeviceMotionUpdatesToQueue( - queue + queue, ) { motion, _ -> if (motion == null) { return@startDeviceMotionUpdatesToQueue