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

@ -55,6 +55,8 @@ class GameSettings {
var useDemographics: Boolean = false
var showZoomButtons: Boolean = false
var androidCutout: Boolean = false
var multiplayer = GameSettingsMultiplayer()
var showExperimentalWorldWrap = false // We're keeping this as a config due to ANR problems on Android phones for people who don't know what they're doing :/

View File

@ -47,6 +47,9 @@ fun advancedTab(
settings.showExperimentalWorldWrap = it
}
if (UncivGame.Current.platformSpecificHelper?.hasDisplayCutout() == true)
optionsPopup.addCheckbox(this, "Enable display cutout (requires restart)", settings.androidCutout, false) { settings.androidCutout = it }
addMaxZoomSlider(this, settings)
val helper = UncivGame.Current.platformSpecificHelper

View File

@ -16,6 +16,9 @@ interface GeneralPlatformSpecificHelpers {
*/
fun allowPortrait(allow: Boolean) {}
fun hasDisplayCutout(): Boolean { return false }
fun toggleDisplayCutout(androidCutout: Boolean) {}
/**
* Notifies the user that it's their turn while the game is running
*/