v3.2.3: updated various iOS inset handling logic

This commit is contained in:
Evan Debenham
2025-08-31 16:12:09 -04:00
parent 6ac8dd09dd
commit 70f2395dd6
2 changed files with 1 additions and 22 deletions

View File

@@ -37,7 +37,6 @@ import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.utils.FileUtils; import com.watabou.utils.FileUtils;
import org.robovm.apple.coregraphics.CGRect;
import org.robovm.apple.foundation.NSAutoreleasePool; import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.foundation.NSBundle; import org.robovm.apple.foundation.NSBundle;
import org.robovm.apple.foundation.NSException; import org.robovm.apple.foundation.NSException;
@@ -102,15 +101,6 @@ public class IOSLauncher extends IOSApplication.Delegate {
config.hideHomeIndicator = true; config.hideHomeIndicator = true;
config.overrideRingerSwitch = SPDSettings.ignoreSilentMode(); config.overrideRingerSwitch = SPDSettings.ignoreSilentMode();
CGRect statusBarFrame = UIApplication.getSharedApplication().getStatusBarFrame();
double statusBarHeight = Math.min(statusBarFrame.getWidth(), statusBarFrame.getHeight());
//if the application has a short status bar (no notch), then hide it
//TODO we do this check elsewhere now, can this be removed?
//if (statusBarHeight <= 24) {
UIApplication.getSharedApplication().setStatusBarHidden(true);
//}
config.useHaptics = true; config.useHaptics = true;
config.useAccelerometer = false; config.useAccelerometer = false;
config.useCompass = false; config.useCompass = false;

View File

@@ -49,21 +49,12 @@ public class IOSPlatformSupport extends PlatformSupport {
@Override @Override
public void updateDisplaySize() { public void updateDisplaySize() {
//non-zero safe insets on left/top/right means device has a notch, show status bar
//TODO turn this into a setting instead?
if (Gdx.graphics.getSafeInsetTop() != 0
|| Gdx.graphics.getSafeInsetLeft() != 0
|| Gdx.graphics.getSafeInsetRight() != 0){
//UIApplication.getSharedApplication().setStatusBarHidden(false);
} else {
UIApplication.getSharedApplication().setStatusBarHidden(true); UIApplication.getSharedApplication().setStatusBarHidden(true);
} }
}
@Override @Override
public boolean supportsFullScreen() { public boolean supportsFullScreen() {
//iOS supports drawing into the gesture safe area //iOS supports drawing into the gesture safe area
//TODO do we want this to control status bar visibility as well, or make that separate?
return Gdx.graphics.getSafeInsetBottom() > 0; return Gdx.graphics.getSafeInsetBottom() > 0;
} }
@@ -102,8 +93,6 @@ public class IOSPlatformSupport extends PlatformSupport {
} }
} }
//TODO if we want to support status bar on-off, then we need a check here to set top inset to 0
return insets; return insets;
} }