Coder Social home page Coder Social logo

air-ane-fullscreen's Introduction

Full Screen ANE for Adobe AIR

One of the most common complaints you hear from Adobe AIR developers is that they can't get true full screen on Android devices that have an on-screen navigation bar (the one that contains the back, home and task buttons), with full screen usually meaning that the buttons are simply replaced with a series of grey dots.

If you're one of those developers, then this AIR Native Extension (ANE) may be the solution you've been looking for.

Released under BSD license. Requires Adobe AIR 20+.

If you only need immersive mode, we recommend using our Immersive Mode ANE instead.

Just give me the ANE!

If you don't care about the source code and just want to download the latest, ready-built ANE, click the releases link at the top of this project's page on GitHub.

How does it work?

This ANE enables developers to offer users a true full screen experience in the Adobe AIR apps for Android.

Using Android 4.0+, you can use true full screen in "lean mode", the way you see in apps like YouTube, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts. This is ideally suited to video or cut-scene content.

In Android 4.4+, however, you can now enter true full screen, fully interactive immersive mode. In this mode, your app will remain in true full screen until you choose otherwise; users can swipe down from the top of the screen to temporarily display the system UI.

In addition, the fullScreen() method works on all mobile platforms supported by Adobe AIR, putting your app into the best available full screen mode: on Android 4.4+, it switches your app into immersive mode, falling back to FULL_SCREEN_INTERACTIVE display state on earlier versions of Android and other mobile platforms.

Workaround for black bar on Android 6.0

A bug in Android 6.0 means some users see 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);

If you need to fix it, fork it!

This is a free, open-source project, so if you find the ANE doesn't work as you might like with a specific device, configuration or library you're using: fork it, fix it, let us know.

Before you start

To avoid cropping, always ensure that you're using <fullScreen>false</fullScreen> in your app.xml and stage.displayState is set to StageDisplayState.NORMAL when using any of the full screen modes invoked by this ANE.

The examples below show how to achieve the best possible full screen experience.

Code example

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

import com.mesmotronic.ane.AndroidFullScreen;

// Properties

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

// Methods

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)

// Example custom full screen mode

AndroidFullScreen.setSystemUiVisibility(AndroidFullScreen.SYSTEM_UI_FLAG_FULLSCREEN | AndroidFullScreen.SYSTEM_UI_FLAG_LOW_PROFILE);

// 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 properties and methods will return false.

The immersiveWidth and immersiveHeight properties return the screen width and height available in immersive mode (or with the system UI hidden), or 0 if the ANE isn't supported.

Therefore, the simplest way to give users the best possible interactive full screen experience in your app is to start your app with <fullScreen>false</fullScreen> in your app.xml and use:

// ANE v1.4.0+ can automatically switch your app into the best available full screen mode

AndroidFullScreen.stage = stage;
AndroidFullScreen.fullScreen();

// ANE v1.3.x

if (!AndroidFullScreen.immersiveMode())
{
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

An easy way to extend your app underneath the status and navigation bars is:

if (!AndroidFullScreen.showUnderSystemUI())
{
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

And a great way to offer full screen video playback is:

if (!AndroidFullScreen.leanMode())
{
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

Getting the immersive screen size

You can use the immersiveWidth and immersiveHeight properties to find out the dimensions of the screen with the system UI hidden, regardless of the current screen state.

To find out the stage size after calling fullScreen(), immersiveMode() or leanMode(), you must wait until the next RESIZE event before the stage.stageWidth and stage.stageHeight properties are updated; the properties of the Capabilities object are not updated and are therefore incorrect.

Starling

To use this ANE with Starling, add Starling.handleLostContext = true; at the start of your ActionScript code to prevent Stage3D lost context errors breaking your app when switching between the normal app state and true full screen.

License

This project has been released under BSD license; see LICENSE for details.

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

air-ane-fullscreen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

air-ane-fullscreen's Issues

Android system back button is overridden by immersvieMode

The following code overrides the Android System Back Button, making it unusable with version 1.3.1 on Lollipop.

if(AndroidFullScreen.isSupported && AndroidFullScreen.isImmersiveModeSupported) {
stage.displayState = StageDisplayState.NORMAL;
AndroidFullScreen.showUnderSystemUI();
AndroidFullScreen.immersiveMode();
}

You can give a simple example about this explanation.

Getting the immersive screen size
You can use the immersiveWidth and immersiveHeight properties to find out the dimensions of the screen with the system UI hidden, regardless of the current screen state.

To find out the stage size after calling fullScreen(), immersiveMode() or leanMode(), you must wait until the next RESIZE event before the stage.stageWidth and stage.stageHeight properties are updated; the properties of the Capabilities object are not updated and are therefore incorrect.

Version 1.5.0 quits right after launch

The app quits as soon as it's launched (shows black screen for half a second)

I'm only including the 1.5.0 ANE, not even referring to it in my project.

I've tried a release and debug build.

Developed with:
AIR 24.0.0.180
IntelliJ IDEA

Tried with:
Nexus 5 6.0.1
OnePlus One 6.0.1

Could the Android minimum/target SDK version be a problem? My current setting is:

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />

Where's the ANE?

It doesn't seem like the ANE is included anywhere in the repo.

I've tried building myself (which required loading a library project just to generate the .swc), but when I include the generated ANE, the entire app just shutdown immediately after startup.

Could you please post a verified and working ANE so implementation is straight forward?
Cheers,

Some devices crash

Hello! We have application published at GooglePlay, and number of crash reports from users containing logs like this:

[ExceptionBacktrace] => java.lang.IllegalArgumentException
at com.adobe.fre.FREContext.dispatchStatusEventAsync(Native Method)
at com.mesmotronic.ane.fullscreen.FullScreenContext$1.onWindowFocusChanged(FullScreenContext.java:114)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2738)
at android.view.View.dispatchWindowFocusChanged(View.java:7996)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1001)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3516)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
at dalvik.system.NativeStart.main(Native Method)

[localizedModel] => LENOVO Lenovo B6000-H

Have any ideas? Thank you

LG Nexus 4 immersiveMode() issue

hello,

LG Nexus 4 (Android 5.1.1)

on load the test app flashes for a split second, then black screen and then the app shows. similar to a resolution swap or screen adjustment on the desktop. i can't seem to be able to hide the "flashing".

the set of calls are:
AndroidFullScreen.showUnderSystemUI();
AndroidFullScreen.immersiveMode();

any idea how to resolve this one?
thanks

Bottom White bar - (Samsung S3 thru S6)

When I use the ANE the status bar disappears as expected but a white bar the same size as the status bar shows up at the bottom.

This happens on all 4 phones I've tested. (Samsung S3 thru S6)

I'm sure I'm doing something wrong.

A similar issue is I get what I think is the samsung legacy menu icon when I publish too. (A semi trans parent circle with 3 dots in it.) Can this be gotten rid of?

Thanks.

fullScreen set to false in manifest causes issues with system bars showing

This may not be an bug, but I thought I'd bring it up in case it can be solved.

I had cropping in my app, which was related to Issue #7

Setting it to:

false

in the Android manifest solved the problem.

However in doing this, it caused other minor problems to appear, that didn't happen when fullScreen was set to true. I have several other ANEs hooked into the app (Google Play Games, Facebook etc.) and when fullScreen is set to false, while those extensions show the status/menu bars show too.

This is happening on two different Android devices (HTC One and Nexus 7) I've tested on, both running Android 5.0.2

I've tried a number of things to try and fix this, but have had no luck so far. Any idea on whether this can be fixed, or is it a limitation of the operating system or Adobe AIR?

Seeing black area in system ui

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

Tried leanmode, immersiveMode(true), fullscreen() everything...but still black on system ui.
If I use showUnderSystemUI(), it shows system ui on top and if I use showUnderSystemUI(), app goes behind systemui on top. But I want to remove system ui completely and app take that place. You have any sample for it?

In my xml, I am using <meta-data android:name="android.max_aspect" android:value="2.16" /> by the way.

Thanks

Viewport size incorrect on Simulator

Hi,

I'm using this ANE and since a long time ago, we have recently updated to its last version and since we need now to set the tags to false on the App Descriptor, everytime we launch the App on the Android Simulator on PC the viewport isn't initialized properly. Our stage gets cut with every different device we test it on, we create the viewport (on Starling) with the following technique:

`
/**

  • Creates the initial viewport for setting up Starling
  • */
    protected function createInitialViewport(stageWidth:Number, stageHeight:Number, maxFullScreenWidth:Number, maxFullScreenHeight:Number):Rectangle
    {
    return RectangleUtil.fit(new Rectangle(0, 0, stageWidth, stageHeight), new Rectangle(0, 0, maxFullScreenWidth, maxFullScreenHeight), StageScaleMode.SHOW_ALL);
    }
    `

Being:
'stageWidth' 640
'stageHeight' 400 (for tablets) and 360 (for phones)
And finally getting these 'maxFullScreenWidth' and 'maxFullScreenHeight' with these two methods:

`
/**

  • Get the full screen width, depending on the device it will vary.
  • */
    override public function getFullScreenWidth():int
    {
    return (AndroidFullScreen.isImmersiveModeSupported && AndroidFullScreen.immersiveWidth > 0) ? AndroidFullScreen.immersiveWidth : stage.fullScreenWidth;
    }

/**

  • Get the full screen height, depending on the device it will vary.
  • */
    override public function getFullScreenHeight():int
    {
    return (AndroidFullScreen.isImmersiveModeSupported && AndroidFullScreen.immersiveHeight > 0) ? AndroidFullScreen.immersiveHeight : stage.fullScreenHeight;
    }
    `

Can you please point me in the right direction? Note: The code on the devices themselves works perfectly and the stage gets fit precisely on its position with the proper size.

Thanks,

system ui displayed when switching back to app

First of all, thanks for the great ANE!!

Not sure if this is a problem with my implementation but when I leave the app and re-enter it, the system ui (bottom menu) stays visible.

This is while running in immersivemode and on Android 4.4.4 (Nexus 5). Works flawlessly on first launch...

Thanks in advance!

Elements get cropped where nav bar used to be

Hi there,

I was playing with this ANE to get immersive mode on my app, but found a small problem.

The following code in the app constructor draws a red bar on left, but below the nav bar, the stage color is shown, the red bar doesn't extend there.

However, if I change the renderMode of my app to "auto" from "direct", the red bar does extend all the way to the bottom of the screen as it should!

My actual app uses Starling (hence renderMode "direct") which renders fine in immersive mode, but it's the parts of the app which are drawn in the traditional display list that get cropped in immersive mode that are my problem!

Any suggestions for a fix?

Thanks!

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
graphics.beginFill(0xff0000, 1);
graphics.drawRect(0, 0, AndroidFullScreen.immersiveWidth / 2, AndroidFullScreen.immersiveHeight);
graphics.endFill();
stage.displayState = StageDisplayState.NORMAL;
if(AndroidFullScreen.immersiveMode()) {
stage.displayState = StageDisplayState.NORMAL;
} else {
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

Samsung Galaxy S3 issues

hello,

a test case on:
Samsung Galaxy S3 (I9300) (Android 4.3)

with an older version of the ANE you can hide the whole system UI, but after a while it suddenly shows the status bar.

with the latest ANE and AIR17 it doesn't hide the system UI at all.

any idea why that happens?
thanks

Why do I have to set -swf-version=28 for the flex compiler for this ane to work?

I would like to use your ane in a flex mobile android application. Unfortunately it doesn't compile until I set the compiler argument: -swf-version=28. Why is this necessary and is there maybe a different way of getting it to compile?

I'm asking because I use a peer2peer approach in this app, which breaks when setting this compiler argument.
NetConnection.Connect.Success still fires then I set up a GroupSpecifier and NetGroup where NetGroup.Connect.Success also fires.

NetGroup.Neighbor.Connect is the event which isn't triggered anymore after setting the additional compiler argument so I would like to avoid setting it.

Thanks in advance for any help!

Question about Compiling against an older SDK

With what Tools do I need to compile this ANE?
By the Way I am using Mac.
And I already tried it with Eclipse ADT, Android Compiler and Flash Builder with the ADT Plugin.

If I change the Runtime in the extension.xml and tried to build it with adt this error occurs:

adt -package -target ane ./AndroidFullScreen.ane extension.xml -swc swc/fullscreen-ane-android.swc -platform Android-ARM -C android . -platform Android-x86 -C android . -platform default -C default .

Invalid swc file. The extension NameSpace requires the SWF verison to be 25 or lower.
(btw. verison (version) is spelled wrong)

I have done nothing before that. I didnt compile anything, especially not the Java Part, since no Programm finds and Project in there.

-- Why do I need to compile it? --

For my Apps I am using: "Apache Flex 4.13.0 - Air 14" and I need it since in newer Versions some Buttons and Styles got removed. And the workload to fix that, would be too huge. But may be done in the future.

So I want to compile the ANE against that, older Version.

I need to have the newest Source as .ANE since there is a Bug which just got fixed in the last 2 Versions, but those need a higher Runtime.

The System UI does not get hidden after the Programm has lost Focus once, that is the Issue I am facing, which got fixed.

With friendly Regards
Jan aka. Sonorpearl

Incompatible namespace

I'm running into the same problem as someone reported in your website:

"Error: The extension com.mesmotronic.ane.fullscreen has either a namespace version or library.swf with a version that is incompatible with the applications namespace or root SWF."

My application is AIR 14+ with the most recent AIR SDK, so that's not the issue. I've compared your ANE files with those of all the other ANEs I'm using, and the only relevant differences I could find are these:

  • All my other ANEs start with the namespace declaration in the first line of the extension.xml file. However, yours has the xml version and encoding information.
  • Your catalog.xml file contains flex version="4.12.1", while all my other ANEs have at most version="4.6.0", which is the latest Flex version from Adobe. I tried installing Apache's Flex 4.13 and still had the same error, though.

Could you please repackage your ANE with the above changes to see if it sorts the problem? I was trying to do it myself but your download package doesn't include the SWC.

Thanks!

I see black strip on my Nexus 5 Android 6

If I run an application from shortcut on desktop or from app list - black strip appears. If I run it from google search bar - it works. It also works well when launched remotely using adb after compilation in IDEA.

Error #3500: The extension context does not have a method with the name init.

I get this error when i try to use the extension:
Error #3500: The extension context does not have a method with the name init.

I am using:
AIR 20.0.0 build 233

Other extensions like milkmangames GoViral work fine. i get the same error when air-ane-fullscreen is the only ane in the project

when i replace the ane with v1.3.3 everything works fine

Not compatible with feathersui MetaworkThemes

Hi,

I use Starling.handleLostContext = true; and it conflict with Starling feathersui MetaworkThemes. I can't create an instance of it.

If I don't use Starling.handleLostContext = true, the objects of feathersui doesn't visible althought I can still interact with them.

Can you show an example of how to use it with the Starling framework?

it takes up the whole screen, but the elements like buttons are too small, what would you recommend?
stage.quality=StageQuality.LOW;
stage.align=StageAlign.TOP_LEFT;
stage.scaleMode=StageScaleMode.NO_SCALE;
//if(AndroidFullScreen.isImmersiveModeSupported)
//{
stage.displayState=StageDisplayState.NORMAL;
AndroidFullScreen.stage=stage;
AndroidFullScreen.fullScreen();
//AndroidFullScreen.immersiveMode();
//}
//screen = new ScreenSetup(stage.fullScreenWidth, stage.fullScreenHeight, [1]);//[1, 2]
//oyuncerceve=new Starling(game,stage,screen.viewPort);
//oyuncerceve.stage.stageWidth =screen.stageWidth;
//oyuncerceve.stage.stageHeight =screen.stageHeight;
oyuncerceve=new Starling(anaekrangiris,stage,new Rectangle(0,0,stage.fullScreenWidth,stage.fullScreenHeight));

Sometimes the UI doesn't go hide

On Nexus 7 2nd edition with Lollipop.
When the app starts the UI hides just fine although if I press and hold the power button, the UI reappear and sometimes when clicking very fast on the screen doesn't go away.

Crashes during load on LG Optimus E970

Thanks for the great extension. I'm testing it on a handful of devices right now and my first test device is having trouble. Maybe I'm doing something wrong here, but my app crashes when the extension is included (no actionscript code except import com.mesmotronic.ane.AndroidFullScreen;

Here's what I'm using in application.xml:

<extensionID>com.mesmotronic.ane.fullscreen</extensionID>

Here's an excerpt from the device log:

http://vpaste.net/VyQva

I'm not sure if this would matter, but I noticed my main project is using -swf-version=25 and the extension is a version 28 swf. Odd since we're using AIR17. I'll try changing that and report back.

Crash on Nexus 7

Hi, often I am getting crashes on Nexus 7 and other devices, this is the stack trace:
I am using the latest version of mesmotronic fullscreen.

`Android: 5.1.1
Manufacturer: asus
Model: Nexus 7
Date: Wed Jan 27 11:51:50 PST 2016

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
at com.mesmotronic.ane.fullscreen.FullScreenContext.getWindow(FullScreenContext.java:91)
at com.mesmotronic.ane.fullscreen.FullScreenContext.getDecorView(FullScreenContext.java:271)
at com.mesmotronic.ane.fullscreen.FullScreenContext.setSystemUiVisibility(FullScreenContext.java:276)
at com.mesmotronic.ane.fullscreen.functions.ImmersiveModeFunction$2.onSystemUiVisibilityChange(ImmersiveModeFunction.java:117)
at android.view.View.dispatchSystemUiVisibilityChanged(View.java:18151)
at android.view.ViewGroup.dispatchSystemUiVisibilityChanged(ViewGroup.java:1441)
at android.view.ViewRootImpl.handleDispatchSystemUiVisibilityChanged(ViewRootImpl.java:5229)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3366)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)`

Also that issue might be causing this other crash:
java.lang.IllegalArgumentException at com.adobe.fre.FREContext.dispatchStatusEventAsync(Native Method) at com.mesmotronic.ane.fullscreen.FullScreenContext$1.onWindowFocusChanged(FullScreenContext.java:114) at com.mesmotronic.ane.fullscreen.functions.ImmersiveModeFunction$3.onWindowFocusChanged(ImmersiveModeFunction.java:136) at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2948) at android.view.View.dispatchWindowFocusChanged(View.java:8376) at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:978) at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3721) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5653) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method)

ANE crops display items where soft button would be

I tried the ANE on a Nexus 7 device with Android 4.4 installed. I could not get any content to draw on the area where the soft buttons would be. The background color was present in this area. I could also draw starling content in this area. Any normal Flash Sprite/MovieClip (DisplayObject) items were cropped.
fullscreenissue

Event for displaying system UI in immersive mode

Hi. How would I detect the system UI being displayed in immersive mode (when user swipes from side to display UI briefly)? This is required to rearrange app's UI a little - increase top padding in header so that system UI bar content won't entirely overlap my app's header icons.

Version 1.3.3 works, version 1.4.3 doesn't work for me

Hi, so i changed my ANE (1.3.3) to the last ANE that appears in the build folder (1.4.3) and when my app gets to the "AndroidFullScreen.immersiveMode() || AndroidFullScreen.leanMode();" line, it gets stuck, not sure why cause i can't debug. If i change to the old ANE file, it works well. Any idea?

Cannot open the app

Hi,

I have used air-fullscreen ane 1.2.x before, everything works fine but sometimes cannot hide the navigation bar automatically. It seems that the issue is fixed, so that I downloaded the latest version 1.3.3. However after I have packaged the apk and installed on my device, the app cannot start. Eclipse only showing that Process com.xxx.xxx has died.

Thanks,

William

Stage not receiving mouse-event

Hello,
When using this code I must tap the screen twice before it receives input.

if(AndroidFullScreen.isSupported){
AndroidFullScreen.immersiveMode() || AndroidFullScreen.hideSystemUI();
}

*Air 15.0.0.302

Xiaomi Note 7 with Android 9 - still black bands on top and bottom

Hi,
Everything seems to work fine, all methods report true.
After calling any mothod though (fullScreen, leanMode, immersiveMode) although they all return true, dimensions stay the same.
immersiveHeight is 2340, while stage.stageHeight stays 2000, and no resize is triggered.
I have followed the instructions precisely. Any hint?
Many thanks

Some devices fail to load.

HI, I am happy to use your ANE and really appreciate your work!
I have found that using ANE causes lock up on some devices.
Following is the log:

※Log
[Starling] Initialization complete.
[Starling] Display Driver: OpenGL (Baseline Constrained)
[AssetManager] Looking for static embedded assets in 'TitleAsset'
[AssetManager] Enqueuing 'xml_title'
[AssetManager] Enqueuing 'title'
[AssetManager] Adding texture 'title'
[Starling] Initialization complete.
[Starling] Display Driver: OpenGL (Baseline Constrained)
status: notLicensed statusReason: +null

It seems Starling initialization is firing twice.
Removing the ANE fixed the problem. (happening on Samsung Galaxy Note 2)

Please help!

Android 11 not supported

Don't know how to implement the new method ...
https://stackoverflow.com/questions/62577645/android-view-view-systemuivisibility-deprecated-what-is-the-replacement

For full screen in JAVA

@OverRide
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
}

WindowInsetsControllerCompat windowInsetsController =
ViewCompat.getWindowInsetsController(getWindow().getDecorView());
if (windowInsetsController == null) {
return;
}
// Hide the system bars.
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars());

// Show the system bars.
windowInsetsController.show(WindowInsetsCompat.Type.systemBars());

private void showSystemUI() {
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);
new WindowInsetsControllerCompat(getWindow(), yourRootView).show(WindowInsetsCompat.Type.systemBars());
}

    private void hideSystemUI() {
        WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
        WindowInsetsControllerCompat controller = new WindowInsetsControllerCompat(getWindow(), yourRootView);
        controller.hide(WindowInsetsCompat.Type.systemBars());
        controller.setSystemBarsBehavior(WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
    }

Remove navbar while keep transparent topbar.

What would it take to create a custom fullscreen display, like show transparent top bar and hide navbar entirely? To make it similar to what iOS has in 7+ versions: overlaying status bar with color provided by application and without navigation buttons.

ContextLoss on touch

Hi! Thanks for you efforts to develop this extension.
We use Starling fork in our project, and Fullscreen version 1.3. worked almost fine (except for crashes for some users). Have downloaded latest 1.4.7 version from github, and now we're facing lost context message in several cases (Starling handles the context loss, so user presented with the special screen while context is recovering, but it isn't shown when ANE Fullscreen 1.3 in use). I still can't understand what in my code could bring that to life.

Native Dialogs show UI

Using some other native extensions for dialogs, when fired they show the UI. Sometimes it goes back to hidden and other times not. This is happening in the Android L preview so not sure if there are differences.

Black stripe in place of the UI bar on Galaxy S3 Neo when calling immersiveMode()

When calling immersiveMode the UI hides but a black stripe remains. After the home button is pressed and then the multitask button to go back to application the black stripe disappears and and everything is fine!
This happens only on Samsung devices with Android 4.4.2 - 4.4.4 as far as i know...
On Nexus 4 and Nexus 7 both running Android 5 there isn't any problem!

There was NOT such problem with the initial release (prior to 1.3). Everything in my manifest is set correctly ... fullscreen is false. Yesterday i have updated to the latest release and the problem emerged.

My as3 code:

if (AndroidFullScreen.immersiveMode()) {
                        stage.displayState = StageDisplayState.NORMAL;
                        scW = AndroidFullScreen.immersiveWidth;
                        scH = AndroidFullScreen.immersiveHeight;
                        NativeApplication.nativeApplication.addEventListener(AndroidFullScreen.ANDROID_WINDOW_FOCUS_IN, onFocusIn);
                    } else {
                        stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                        scW = stage.fullScreenWidth;
                        scH = stage.fullScreenHeight;
                    }

So i tried everything in as3, for example showUnderSystemUI() has the same issue.
The problem should be somewhere on the java side.

I still not very familiar with the Android immersive mode API, but i suspect the problem is somewhere in the resetUi method on the FullScreenContext class:

public void resetUi()
    {
        final View decorView = getDecorView();
        final Window window = getWindow();

        decorView.setOnFocusChangeListener(getOnFocusChangeListener());
        decorView.setOnSystemUiVisibilityChangeListener(null);

        window.clearFlags
        (
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN
            | WindowManager.LayoutParams.FLAG_FULLSCREEN
            | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION 
            | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
        );

        init(); 

        setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
    }

I suspect the window.clearFlags call ... not sure yet.

I will update as soon as i find more!
Anyone else with a Samsung device to reproduce the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.