v3.2.3: last minute Android fixes and re-upped version code for Android:
- fixed crashes on Android 9 and 10 by swapping to 'shortEdges' cutout mode ('always' cutout display mode wasn't present in these versions)
- upped fullscreen check to Android 9+, assume navbar exists in prior versions
- fixed navbar inset always being ignored in Android 9-14
This commit is contained in:
@@ -56,8 +56,9 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean supportsFullScreen(){
|
public boolean supportsFullScreen(){
|
||||||
//Android supports hiding the navigation bar or gesture bar, if it is present
|
//We support hiding the navigation bar or gesture bar, if it is present
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
// on Android 9+ we check for this, on earlier just assume it's present
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
WindowInsets insets = AndroidLauncher.instance.getApplicationWindow().getDecorView().getRootWindowInsets();
|
WindowInsets insets = AndroidLauncher.instance.getApplicationWindow().getDecorView().getRootWindowInsets();
|
||||||
return insets != null && (insets.getStableInsetBottom() > 0 || insets.getStableInsetRight() > 0 || insets.getStableInsetLeft() > 0);
|
return insets != null && (insets.getStableInsetBottom() > 0 || insets.getStableInsetRight() > 0 || insets.getStableInsetLeft() > 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -70,14 +71,12 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||||||
RectF insets = new RectF();
|
RectF insets = new RectF();
|
||||||
|
|
||||||
//getting insets technically works down to 6.0 Marshmallow, but we let the device handle all of that prior to 9.0 Pie
|
//getting insets technically works down to 6.0 Marshmallow, but we let the device handle all of that prior to 9.0 Pie
|
||||||
//TODO test on Android P emulator!
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && !AndroidLauncher.instance.isInMultiWindowMode()) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && !AndroidLauncher.instance.isInMultiWindowMode()) {
|
||||||
WindowInsets rootInsets = AndroidLauncher.instance.getApplicationWindow().getDecorView().getRootWindowInsets();
|
WindowInsets rootInsets = AndroidLauncher.instance.getApplicationWindow().getDecorView().getRootWindowInsets();
|
||||||
if (rootInsets != null) {
|
if (rootInsets != null) {
|
||||||
|
|
||||||
//Navigation bar (never on the top)
|
//Navigation bar (never on the top)
|
||||||
//Android 14 and below do this for us
|
if (supportsFullScreen() && !SPDSettings.fullscreen()) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM && supportsFullScreen() && !SPDSettings.fullscreen()) {
|
|
||||||
insets.left = Math.max(insets.left, rootInsets.getStableInsetLeft());
|
insets.left = Math.max(insets.left, rootInsets.getStableInsetLeft());
|
||||||
insets.right = Math.max(insets.right, rootInsets.getStableInsetRight());
|
insets.right = Math.max(insets.right, rootInsets.getStableInsetRight());
|
||||||
insets.bottom = Math.max(insets.bottom, rootInsets.getStableInsetBottom());
|
insets.bottom = Math.max(insets.bottom, rootInsets.getStableInsetBottom());
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- Newer Material translucent theme for Android 9+ that lets them go true fullscreen -->
|
<!-- Newer Material translucent theme for Android 9+ that lets them go true fullscreen -->
|
||||||
<style name="GameTheme" parent="@android:style/Theme.Material.NoActionBar.TranslucentDecor">
|
<style name="GameTheme" parent="@android:style/Theme.Material.NoActionBar.TranslucentDecor">
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">
|
<item name="android:windowLayoutInDisplayCutoutMode">
|
||||||
always <!-- For Android 14- devices, edge-to-edge is automatic for Android 15+ -->
|
shortEdges <!-- For Android 14- devices. Edge-to-edge is automatic for Android 15+ -->
|
||||||
</item>
|
</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -14,7 +14,7 @@ allprojects {
|
|||||||
appName = 'Shattered Pixel Dungeon'
|
appName = 'Shattered Pixel Dungeon'
|
||||||
appPackageName = 'com.shatteredpixel.shatteredpixeldungeon'
|
appPackageName = 'com.shatteredpixel.shatteredpixeldungeon'
|
||||||
|
|
||||||
appVersionCode = 866
|
appVersionCode = 867
|
||||||
appVersionName = '3.2.3'
|
appVersionName = '3.2.3'
|
||||||
|
|
||||||
appJavaCompatibility = JavaVersion.VERSION_11
|
appJavaCompatibility = JavaVersion.VERSION_11
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ public class v3_X_Changes {
|
|||||||
"Fixed the following bugs:\n" +
|
"Fixed the following bugs:\n" +
|
||||||
"**Caused by v3.2.2:**\n" +
|
"**Caused by v3.2.2:**\n" +
|
||||||
"**-** Windowed mode on desktop always defaulting to 1920x1080, instead of last window size\n" +
|
"**-** Windowed mode on desktop always defaulting to 1920x1080, instead of last window size\n" +
|
||||||
"**-** Various rare Android crashes caused by internal library updates"));
|
"**-** Various rare Android crashes caused by internal library updates\n" +
|
||||||
|
"**-** Fullscreen being incorrectly forced off on some older Android devices."));
|
||||||
|
|
||||||
changes = new ChangeInfo("v3.2.2", false, null);
|
changes = new ChangeInfo("v3.2.2", false, null);
|
||||||
changes.hardlight(Window.TITLE_COLOR);
|
changes.hardlight(Window.TITLE_COLOR);
|
||||||
|
|||||||
Reference in New Issue
Block a user