Code Monkey home page Code Monkey logo

Comments (10)

Kelsonk avatar Kelsonk commented on June 12, 2024

I can confirm that SystemGestures.isSupported is false for Android. Do you think this can be implemented for Android as well? Maybe I can find another Ane that does this.

from ane-systemgestures.

marchbold avatar marchbold commented on June 12, 2024

Correct, this is an iOS only extension currently.

Have you got a link to the native functionality you are looking for? Happy to look into adding it.

from ane-systemgestures.

Kelsonk avatar Kelsonk commented on June 12, 2024

I believe it's related to this.

https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List%3Candroid.graphics.Rect%3E)

I opened on a topic on the Starling forum about my issue, and someone said to use the Application ANE and set the display mode to immersive, but I don't believe they're talking about the same issue as I'm having.

https://forum.starling-framework.org/d/23851-disable-system-gesture-swipes-on-android

from ane-systemgestures.

marchbold avatar marchbold commented on June 12, 2024

Fullscreen immersive should allow you to get around the edge gestures I believe as Android disables them in this mode. I some updates to look into around this though as I believe some of those modes have been deprecated in the latest android sdk but I believe this should still work.

Decent overview here: https://medium.com/androiddevelopers/gesture-navigation-handling-gesture-conflicts-8ee9c2665c69

from ane-systemgestures.

Kelsonk avatar Kelsonk commented on June 12, 2024

All I can say is that it's definitely not working for me on Android 10. I'd be surprised if I've implemented something incorrectly since it's pretty simple. I turned system gestures on on my phone, and any swipe from the side temporarily shows an arrow and will close the app on release. The status and nav bars are never visible on my phone at any time.

Either way, it would be nice to set the exclusion rects manually. People can swipe back to exit the app if they want, but only outside of the game board, which reaches the edges of the screen.

Here's a video of how it behaves.
https://youtube.com/shorts/pQUHQsPTRoM?feature=share

I'm actually wondering if this is something specific to the Xiaomi OS, which is what I have. I need more smart phones.

from ane-systemgestures.

marchbold avatar marchbold commented on June 12, 2024

Yeah this behaviour is very likely tied to the android flavour you are testing on.

I've done some initial research into these exclusion rects and they are very limited. You can only specify about 200dp of vertical space that overrides the default action. So I'd have to redesign the api or something new for this.

from ane-systemgestures.

Kelsonk avatar Kelsonk commented on June 12, 2024

Thanks for looking into it. I'd be more concerned about the horizontal space and preventing back swipes, 200 dp would be more than enough I'd think. Even immersive mode (if I could get it working) wouldn't be great, it still tries to pre open a menu on a first swipe.

Anyways, I shrank my game board to 90% of the width of the screen. It'd be nice to have the extra space since it can be a 16x16 grid but it works for now. Thanks again for checking it out.

from ane-systemgestures.

Kelsonk avatar Kelsonk commented on June 12, 2024

Not to belabor this too much but is there a way to override the 'back' gesture? For most big apps (Twitter, Instagram), the back gesture doesn't close the app, but just goes to the previous screen or something.

from ane-systemgestures.

marchbold avatar marchbold commented on June 12, 2024

Of course, just listen to the keyboard event and then call prevent default when it is the back operation.

NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);

function onKeyDownHandler( event:KeyboardEvent ):void 
{
    if (event.keyCode == Keyboard.BACK)
    {
        event.preventDefault(); 
    }
}

from ane-systemgestures.

Kelsonk avatar Kelsonk commented on June 12, 2024

from ane-systemgestures.

Related Issues (9)

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.