added cutout support (#7044)

* added support

* now toggleable in settings

* translation

* added note that it requires restart

* made it enabled by default

* padded buttons to the right if there is a cutout

* checking for cutout instead of android

* reverted button changes

* moved option to advancedTab
This commit is contained in:
alexban011
2022-06-14 20:34:30 +03:00
committed by GitHub
parent cac616a97b
commit fc926420e8
6 changed files with 39 additions and 1 deletions

View File

@ -2,7 +2,9 @@ package com.unciv.app
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationManagerCompat
import androidx.work.WorkManager
import com.badlogic.gdx.backends.android.AndroidApplication
@ -33,10 +35,14 @@ open class AndroidLauncher : AndroidApplication() {
val settings = GameSaver.getSettingsForPlatformLaunchers(filesDir.path)
val fontFamily = settings.fontFamily
// Manage orientation lock
// Manage orientation lock and display cutout
val platformSpecificHelper = PlatformSpecificHelpersAndroid(this)
platformSpecificHelper.allowPortrait(settings.allowAndroidPortrait)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
platformSpecificHelper.toggleDisplayCutout(settings.androidCutout)
}
val androidParameters = UncivGameParameters(
version = BuildConfig.VERSION_NAME,
crashReportSysInfo = CrashReportSysInfoAndroid,