Skip to content

AndroidFullScreen ANE 1.4.6

Latest
Compare
Choose a tag to compare
@neilrackett neilrackett released this 17 Jan 14:13
· 12 commits to master since this release

Release notes

This release improves performance in Android 6 Marshmallow and resolves issues #27, which caused problems when testing apps in the AIR simulator.

This ANE is released under BSD license and requires Adobe AIR 19+.

Workaround for issue #24 (black bar on Android 6.0)

A bug in Android 6.0 means some users are seeing a black bar at the bottom of their screen when using this ANE. This issue is resolved in Android 6.0.1, but if you haven't received the upgrade yet, you can fix it by changing the stage orientation twice, for example:

AndroidFullScreen.stage = stage;
AndroidFullScreen.fullScreen();
stage.setOrientation(StageOrientation.UPSIDE_DOWN);
stage.setOrientation(StageOrientation.UPSIDE_DOWN);

(Thanks to @m72 for the workaround)

Code example

Using the ANE in your app couldn't be easier:

import com.mesmotronic.ane.AndroidFullScreen;

// Methods

AndroidFullScreen.stage = stage; // Set this to your app's stage
AndroidFullScreen.isSupported; // Is this ANE supported?
AndroidFullScreen.isImmersiveModeSupported; // Is immersive mode supported?
AndroidFullScreen.immersiveWidth; // The width of the screen in immersive mode
AndroidFullScreen.immersiveHeight; // The height of the screen in immersive mode
AndroidFullScreen.fullScreenWidth; // The width of the screen in the best available full screen mode
AndroidFullScreen.fullScreenHeight; // The height of the screen in the best available full screen mode

AndroidFullScreen.fullScreen(); // Switch your app to the best available full screen mode
AndroidFullScreen.showSystemUI(); // Show system UI
AndroidFullScreen.leanMode(); // Hide system UI until user interacts
AndroidFullScreen.showUnderSystemUI(); // Extend your app underneath the system UI (Android 4.4+ only)
AndroidFullScreen.immersiveMode(); // Hide system UI and keep it hidden (Android 4.4+ only)
AndroidFullScreen.immersiveMode(false); // Hide system UI until user swipes from top (Android 4.4+ only)

// Events (will only work if ANE is supported)

NativeApplication.nativeApplication.addEventListener(AndroidFullScreen.ANDROID_WINDOW_FOCUS_IN, focusHandler);
NativeApplication.nativeApplication.addEventListene(AndroidFullScreen.ANDROID_WINDOW_FOCUS_OUT, focusHandler);

function focusHandler(event:Event):void
{
    trace(event.type);
} 

All methods return Boolean values: true if the action was successful, false if it wasn't (or isn't supported); if you're using the ANE in an app for a platform other than Android, all methods will return false.

Make a donation

If you find this project useful, why not buy us a coffee (or as many as you think it's worth)?

Make a donation