v3.2.3: updated various iOS inset handling logic
This commit is contained in:
@@ -37,7 +37,6 @@ import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.FileUtils;
|
||||
|
||||
import org.robovm.apple.coregraphics.CGRect;
|
||||
import org.robovm.apple.foundation.NSAutoreleasePool;
|
||||
import org.robovm.apple.foundation.NSBundle;
|
||||
import org.robovm.apple.foundation.NSException;
|
||||
@@ -102,15 +101,6 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
||||
config.hideHomeIndicator = true;
|
||||
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.useAccelerometer = false;
|
||||
config.useCompass = false;
|
||||
|
||||
@@ -49,21 +49,12 @@ public class IOSPlatformSupport extends PlatformSupport {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsFullScreen() {
|
||||
//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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user