-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also works on Android Gesture Navigation? #9
Comments
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. |
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. |
I believe it's related to this. 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 |
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 |
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. I'm actually wondering if this is something specific to the Xiaomi OS, which is what I have. I need more smart phones. |
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. |
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. |
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. |
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();
}
} |
Sorry to bother you, just bringing this issue to your attention. I'm in a
bit of a rush, I unwisely set this build live after updating all my ANE's
without testing it so my game crashes on startup for everyone now.
distriqt/ANE-Adverts-Mediation#67
…On Fri, Sep 8, 2023 at 12:12 AM Michael ***@***.***> wrote:
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();
}
}
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQYEYTIOMEB37HIFXFM6WTXZJBD5ANCNFSM6AAAAAA37PEZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi, in the change logs and elsewhere, I see only references to iOS for this ANE. Does this also work for Android? I'd just like a definitive answer since gesture navigation came more recently to Android than it did for iOS. Thanks!
The text was updated successfully, but these errors were encountered: