From 19877999f8676a7ab38a22e446858d78d04a3dc7 Mon Sep 17 00:00:00 2001 From: "eric.marchand" Date: Wed, 14 Aug 2024 15:49:38 +0200 Subject: [PATCH] Support new app info property to lock orientation #21 --- .../qmobile/qmobileui/activity/mainactivity/MainActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qmobileui/src/main/java/com/qmobile/qmobileui/activity/mainactivity/MainActivity.kt b/qmobileui/src/main/java/com/qmobile/qmobileui/activity/mainactivity/MainActivity.kt index a16bb5d8..1807a66e 100644 --- a/qmobileui/src/main/java/com/qmobile/qmobileui/activity/mainactivity/MainActivity.kt +++ b/qmobileui/src/main/java/com/qmobile/qmobileui/activity/mainactivity/MainActivity.kt @@ -11,6 +11,7 @@ import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.content.Intent +import android.content.pm.ActivityInfo import android.net.ConnectivityManager import android.net.Uri import android.os.Build @@ -162,6 +163,8 @@ class MainActivity : ToastMessage.context = getApplicationContext() super.onCreate(savedInstanceState) + if (BaseApp.runtimeDataHolder.lockOrientation) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + signalHandler = SignalHandler(this).apply { initSignalHandler() }