EOPATCH: disable screen rotation during activation

This commit is contained in:
Milos Kozak 2023-05-14 10:04:07 +02:00
parent 0dad5ca499
commit fba804b2cb

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.pm.ActivityInfo
import android.media.MediaPlayer import android.media.MediaPlayer
import android.media.RingtoneManager import android.media.RingtoneManager
import android.os.Bundle import android.os.Bundle
@ -38,9 +39,10 @@ class EopatchActivity : EoBaseActivity<ActivityEopatchBinding>() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LOCKED
binding.apply { binding.apply {
viewModel = ViewModelProvider(this@EopatchActivity, viewModelFactory).get(EopatchViewModel::class.java) viewModel = ViewModelProvider(this@EopatchActivity, viewModelFactory)[EopatchViewModel::class.java]
viewModel?.apply { viewModel?.apply {
processIntent(intent) processIntent(intent)
@ -254,7 +256,7 @@ class EopatchActivity : EoBaseActivity<ActivityEopatchBinding>() {
mProgressDialog?.let { mProgressDialog?.let {
try { try {
mProgressDialog?.dismiss() mProgressDialog?.dismiss()
} catch (e: IllegalStateException) { } catch (ignored: IllegalStateException) {
} }
mProgressDialog = null mProgressDialog = null
} }
@ -264,7 +266,7 @@ class EopatchActivity : EoBaseActivity<ActivityEopatchBinding>() {
mPatchCommCheckDialog?.let { mPatchCommCheckDialog?.let {
try { try {
mPatchCommCheckDialog?.dismiss() mPatchCommCheckDialog?.dismiss()
} catch (e: IllegalStateException) { } catch (ignored: IllegalStateException) {
} }
mPatchCommCheckDialog = null mPatchCommCheckDialog = null
} }