mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
add landscape support for tablet devices
This commit is contained in:
parent
47e577c947
commit
3cfdc56dad
@ -27,8 +27,6 @@
|
|||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:resizeableActivity="false"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
|
||||||
|
@ -16,8 +16,10 @@
|
|||||||
|
|
||||||
package com.yubico.authenticator
|
package com.yubico.authenticator
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.*
|
import android.content.*
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
||||||
|
import android.content.pm.ActivityInfo
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.hardware.camera2.CameraCharacteristics
|
import android.hardware.camera2.CameraCharacteristics
|
||||||
import android.hardware.camera2.CameraManager
|
import android.hardware.camera2.CameraManager
|
||||||
@ -71,6 +73,12 @@ class MainActivity : FlutterFragmentActivity() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
if (resources.getBoolean(R.bool.portrait_only)) {
|
||||||
|
@SuppressLint("SourceLockedOrientationActivity")
|
||||||
|
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||||
|
}
|
||||||
|
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
|
||||||
allowScreenshots(false)
|
allowScreenshots(false)
|
||||||
|
4
android/app/src/main/res/values-sw533dp/bools.xml
Normal file
4
android/app/src/main/res/values-sw533dp/bools.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="portrait_only">false</bool>
|
||||||
|
</resources>
|
4
android/app/src/main/res/values-xlarge/bools.xml
Normal file
4
android/app/src/main/res/values-xlarge/bools.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="portrait_only">false</bool>
|
||||||
|
</resources>
|
4
android/app/src/main/res/values/bools.xml
Normal file
4
android/app/src/main/res/values/bools.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="portrait_only">true</bool>
|
||||||
|
</resources>
|
Loading…
Reference in New Issue
Block a user