diff --git a/android/src/com/unciv/app/PlatformSpecificHelpersAndroid.kt b/android/src/com/unciv/app/PlatformSpecificHelpersAndroid.kt index efbbd679a3..74a4530184 100644 --- a/android/src/com/unciv/app/PlatformSpecificHelpersAndroid.kt +++ b/android/src/com/unciv/app/PlatformSpecificHelpersAndroid.kt @@ -35,12 +35,15 @@ Sources for Info about current orientation in case need: if (activity.requestedOrientation != orientation) activity.requestedOrientation = orientation } - override fun hasDisplayCutout(): Boolean { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + override fun hasDisplayCutout() = when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.R -> + activity.display?.cutout != null + Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q -> + @Suppress("DEPRECATION") activity.windowManager.defaultDisplay.cutout != null - } else { - false - } + Build.VERSION.SDK_INT >= Build.VERSION_CODES.P -> + activity.window.decorView.rootWindowInsets.displayCutout != null + else -> false } override fun toggleDisplayCutout(androidCutout: Boolean) { diff --git a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt index ee7c4a04dd..51b482ee55 100644 --- a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt @@ -50,7 +50,6 @@ class PlayerPickerTable( ): Table() { val playerListTable = Table() val civBlocksWidth = if(blockWidth <= 10f) previousScreen.stage.width / 3 - 5f else blockWidth - val friendsBlocksWidth = if(blockWidth <= 10f) previousScreen.stage.width / 5 - 5f else blockWidth / 2 /** Locks player table for editing, currently unused, was previously used for scenarios and could be useful in the future.*/ var locked = false diff --git a/tests/src/com/unciv/testing/TranslationTests.kt b/tests/src/com/unciv/testing/TranslationTests.kt index 0ef51734c6..b5626c0c22 100644 --- a/tests/src/com/unciv/testing/TranslationTests.kt +++ b/tests/src/com/unciv/testing/TranslationTests.kt @@ -171,7 +171,7 @@ class TranslationTests { var allWordsTranslatedCorrectly = true for (translationEntry in translations.values) { - for ((language, translation) in translationEntry) { + for ((language, _) in translationEntry) { UncivGame.Current.settings.language = language try { translationEntry.entry.tr()