Home Features Docs Blog Support GitHub

Hide Home Indicator (LibGDX)


(Tien Do Nam) #1

Hello guys,

I am building a game in LibGDX and want to hide the home indicator in iPhone X. After my research I found out that I have to overwrite “prefersHomeIndicatorAutoHidden”.
However I don’t know where to overwrite it in my LibGDX game.

Thanks
Tien

public class IOSMoeLauncher extends IOSApplication.Delegate implements LanguageInterface, OSVersionInterface {

    protected IOSMoeLauncher(Pointer peer) {
        super(peer);
    }

    @Override
    protected IOSApplication createApplication() {
        IOSApplicationConfiguration config = new IOSApplicationConfiguration();
        config.useAccelerometer = false;
        return new IOSApplication(new MainKlasse(this), config);
    }

    public static void main(String[] argv) {
        UIKit.UIApplicationMain(0, null, null, IOSMoeLauncher.class.getName());

    }

    @Override
    public String getLanguageCode() {
        NSLocale nsLocale = NSLocale.autoupdatingCurrentLocale();
        return nsLocale.objectForKey(Foundation.NSLocaleLanguageCode()).toString();
    }

    @Override
    public String getOSVersion() {
        NSOperatingSystemVersion version = NSProcessInfo.processInfo().operatingSystemVersion();
        long major = version.majorVersion();
        long minor = version.minorVersion();
        long patch = version.patchVersion();
        return major+"."+minor+"."+patch;
    }
}