Giter Site home page Giter Site logo

Comments (11)

neilrackett avatar neilrackett commented on July 29, 2024

The problem is in your AS3 code: you need to change the displayState to normal before calling immersiveMode().

from air-ane-fullscreen.

wastedabuser avatar wastedabuser commented on July 29, 2024

When i said i tried everything in as3 i also thought about it. I tried this code also:

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

If i place a debugger break-point on immersiveMode() call the stripe disappears...

from air-ane-fullscreen.

neilrackett avatar neilrackett commented on July 29, 2024

This issue has been discussed several times in previous issues and the easiest way to prevent it is to ensure that you set <fullScreen>false</fullScreen> in your app.xml and use:

if (!AndroidFullScreen.immersiveMode())
{
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    // full screen code
}
else
{
    // immersive mode code
}

The code above won't work if you're starting your app with <fullScreen>true</fullScreen> in app.xml because changing stage.displayState doesn't take effect immediately; it takes ~1 frame, meaning it the display state hasn't actually changed when you call immersiveMode().

from air-ane-fullscreen.

wastedabuser avatar wastedabuser commented on July 29, 2024

Dude, the fullScreen is set to false in the xml (as i stated in my first post).
Your code does not work either... :(
I even tried adding a 5 second timeout after the stage.displayState is set and then call immersiveMode...

Reverted to this commit 0e18f9c (the one before your 1.3.0 release) and it all works fine!

from air-ane-fullscreen.

neilrackett avatar neilrackett commented on July 29, 2024

Can you watch the output from your app via DDMS using Eclipse or Android Studio and let me know if you see any errors?

from air-ane-fullscreen.

wastedabuser avatar wastedabuser commented on July 29, 2024

I have access to this device only at night :)
The first thing i checked is for errors ... well there aren't any

It seems my hypothesis is right. I have commented this block

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

Now everything is working correctly, at least for me...
Excuse me for my ignorance, but why do you need it?

I am forking and pushing my setup here: https://github.com/wastedabuser/air-fullscreen-ane. I have also added a build.xml for quick command line ant build.

from air-ane-fullscreen.

neilrackett avatar neilrackett commented on July 29, 2024

The clearFlags call is used to ensure the UI is reset correctly when switching between various modes, but if it's causing issues with Samsung devices, I'll revise/move it and add in your build script.

from air-ane-fullscreen.

wastedabuser avatar wastedabuser commented on July 29, 2024

Well i guess there should be a flag that bypasses the initial call of the resetUi. I guess you don't need to call resetUI when calling immersiveMode for the first time (my tests confirm this also).

Something like:

    public void resetUi()
    {
        if (!allowResetUi){
            allowResetUi = true;
            return;
        }

        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);
    }

Anyway, thank you for your work!

Regards,

from air-ane-fullscreen.

neilrackett avatar neilrackett commented on July 29, 2024

Removing clearFlags caused problems with showSystemUI, so I've moved the code around and it looks like it's working as expected on a couple of test devices here. I've also added in your ant script.

Can you give pre-release 1.3.3 a try on your Neo and let me know if it resolves the issues?

from air-ane-fullscreen.

wastedabuser avatar wastedabuser commented on July 29, 2024

Yes, it works properly on all my devices now!
Thanks!

from air-ane-fullscreen.

neilrackett avatar neilrackett commented on July 29, 2024

:-)

from air-ane-fullscreen.

Related Issues (20)

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.