From fba804b2cb29e7ca25bad43a696bd77e1bf54fdf Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 14 May 2023 10:04:07 +0200 Subject: [PATCH] EOPATCH: disable screen rotation during activation --- .../androidaps/plugins/pump/eopatch/ui/EopatchActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchActivity.kt index ec87c01790..efee9315e4 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchActivity.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.app.Dialog import android.content.Context import android.content.Intent +import android.content.pm.ActivityInfo import android.media.MediaPlayer import android.media.RingtoneManager import android.os.Bundle @@ -38,9 +39,10 @@ class EopatchActivity : EoBaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LOCKED binding.apply { - viewModel = ViewModelProvider(this@EopatchActivity, viewModelFactory).get(EopatchViewModel::class.java) + viewModel = ViewModelProvider(this@EopatchActivity, viewModelFactory)[EopatchViewModel::class.java] viewModel?.apply { processIntent(intent) @@ -254,7 +256,7 @@ class EopatchActivity : EoBaseActivity() { mProgressDialog?.let { try { mProgressDialog?.dismiss() - } catch (e: IllegalStateException) { + } catch (ignored: IllegalStateException) { } mProgressDialog = null } @@ -264,7 +266,7 @@ class EopatchActivity : EoBaseActivity() { mPatchCommCheckDialog?.let { try { mPatchCommCheckDialog?.dismiss() - } catch (e: IllegalStateException) { + } catch (ignored: IllegalStateException) { } mPatchCommCheckDialog = null }