diff --git a/ios/build.gradle b/ios/build.gradle index 173cf83de..c9a761ca6 100644 --- a/ios/build.gradle +++ b/ios/build.gradle @@ -46,7 +46,10 @@ dependencies { implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" implementation "com.mobidevelop.robovm:robovm-rt:$robovmVersion" implementation "com.mobidevelop.robovm:robovm-cocoatouch:$robovmVersion" - implementation "com.badlogicgames.gdx:gdx-backend-robovm-metalangle:$gdxVersion" + //FIXME using a prior version of metalangle backend as 1.13.5+ crashes on A7 and A8 devices + // Yes this is dangerous, the old backend seems to only work with libGDX 1.14.0 incidentally + // Ideally the next release of libGDX will fix this and this can simply use $gdxVersion again + implementation "com.badlogicgames.gdx:gdx-backend-robovm-metalangle:1.13.1" implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios" implementation "com.badlogicgames.gdx-controllers:gdx-controllers-ios:$gdxControllersVersion" diff --git a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java index 9caddae98..edfa8e33e 100644 --- a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java +++ b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSLauncher.java @@ -22,8 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.ios; import com.badlogic.gdx.Files; +import com.badlogic.gdx.backends.iosrobovm.DefaultIOSInput; import com.badlogic.gdx.backends.iosrobovm.IOSApplication; import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration; +import com.badlogic.gdx.backends.iosrobovm.IOSInput; import com.badlogic.gdx.backends.iosrobovm.IOSPreferences; import com.badlogic.gdx.backends.iosrobovm.bindings.metalangle.MGLDrawableColorFormat; import com.badlogic.gdx.backends.iosrobovm.bindings.metalangle.MGLDrawableDepthFormat; @@ -45,6 +47,7 @@ import org.robovm.apple.foundation.NSObject; import org.robovm.apple.foundation.NSString; import org.robovm.apple.uikit.UIApplication; import org.robovm.apple.uikit.UIInterfaceOrientation; +import org.robovm.apple.uikit.UITextField; import java.io.File; @@ -185,7 +188,22 @@ public class IOSLauncher extends IOSApplication.Delegate { config.addIosDevice("SIMULATOR_64", "x86_64", 460); config.addIosDevice("SIMULATOR_ARM64", "arm64", 460); - return new IOSApplication(new ShatteredPixelDungeon(new IOSPlatformSupport()), config); + return new IOSApplication(new ShatteredPixelDungeon(new IOSPlatformSupport()), config){ + @Override + protected IOSInput createInput() { + //FIXME essentially a backport of a fix to text fields from libGDX ios backend 1.13.5 + return new DefaultIOSInput(this){ + @Override + public void setOnscreenKeyboardVisible(boolean visible, OnscreenKeyboardType type) { + super.setOnscreenKeyboardVisible(visible, type); + if (visible){ + ((UITextField)getActiveKeyboardTextField()).setText("x"); + } + } + }; + + } + }; } @Override