lichobile icon indicating copy to clipboard operation
lichobile copied to clipboard

Android 10 Gesture Navigation problem with back gesture breaks moving pieces from columns h and a

Open martinhamel opened this issue 5 years ago • 8 comments

I'm submitting a ... :

  • bug report

Bug report

Current behavior:

Since Android 10 new gesture navigation, moving a piece from the side of the board during play is triggering the back behaviour, breaking the game.

Expected behavior:

The back gesture should be disabled as described in the new gesture documentation: https://developer.android.com/guide/navigation/gesturenav

Steps to reproduce:

While having Android 10 and gesture enabled, just move a piece from the h column to another column.

Environment information

Android 10 with gesture enabled on Pixel 3a.

Other information:

martinhamel avatar Sep 05 '19 01:09 martinhamel

Thanks for the report.

We'll need to figure out if there is a place where we can insert this native code as a temporarily fix until there is an official cordova fix.

On Wed, Sep 4, 2019 at 9:35 PM martinhamel [email protected] wrote:

I'm submitting a ... :

  • bug report

Bug report

Current behavior:

Since Android 10 new gesture navigation, moving a piece from the side of the board during play is triggering the back behaviour, breaking the game.

Expected behavior:

The back gesture should be disabled as described in the new gesture documentation: https://developer.android.com/guide/navigation/gesturenav

Steps to reproduce:

While having Android 10 and gesture enabled, just move a piece from the h column to another column.

Environment information

Android 10 with gesture enabled on Pixel 3a.

Other information:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/veloce/lichobile/issues/1027?email_source=notifications&email_token=AAHJC5VLIGF2DNCMV2MUEPTQIBO4RA5CNFSM4ITYJUYKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJM4ZEQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHJC5SGYHLCBGWVTEWYEPLQIBO4RANCNFSM4ITYJUYA .

freefal avatar Sep 05 '19 13:09 freefal

Please! I "abandoned" accidentally some games due to this error. Now they want to ban me.

santificex avatar Sep 22 '19 18:09 santificex

As a quick fix, consider turning off gestures prior to opening the app.

freefal avatar Sep 23 '19 01:09 freefal

This is also frustrating me and has been for a year.. from the android dev doco at https://developer.android.com/training/gestures/gesturenav :

To maintain functionality of elements on the left and right edges of the screen, you'll need to opt out of the Back gesture selectively by indicating to the system which regions need to receive touch input. You can do this by passing a List<Rect> to the View.setSystemGestureExclusionRects() API introduced in Android 10.

Is this a result of the library you're using? I can have a crack at fixing it if it's not known to be impossible and this is simply a low priority.

dylandhall avatar Oct 14 '20 01:10 dylandhall

Hi guys, I've done some more research and found on a japanese blog here: https://blog.asial.co.jp/1663 (google translate helped me here!) that a helpful dev has actually written a cordova plugin to do this for you: https://github.com/keeey/cordova-plugin-system-gesture

is this something that could help?

dylandhall avatar Oct 15 '20 01:10 dylandhall

There seem to be a few options for addressing this issue:

  1. Disable the gestures during game play, as suggested by the original issue report. There exists a cordova plugin for this.
  2. Make the board slightly smaller, so that it doesn't occupy the area used for gestures. There exists a capacitor plugin which provides access to the boundaries of the "safe area".
  3. Ask for confirmation before leaving the game. This is pretty simple to implement, but a dialog still disrupts game play, so I think this is not ideal
  4. Simply don't allow the user to go back from the game board. Instead, they would have to use the hamburger menu to go back to the home screen.

If the lichobile maintainers could provide some guidance on what is the best approach, I am happy to submit a PR for it as this has caused my bullet rating to plummet since upgrading my phone. 😄

mdz avatar Sep 19 '21 18:09 mdz

Thanks for volunteering @mdz ! I think the best option will be to use or develop a Cordova or Capacitor plugin. lichobile's maintainer is hard at work migrating the project to Capacitor 3, so I'd recommend holding off until that work is complete.

jas14 avatar Sep 26 '21 13:09 jas14

I'm not the most knowledgeable here, but would disabling the gestures have any compatibility issues with custom Android gesture implementations, like Samsung's game mode (requires a double swipe while in game)?

An toggle option to just shrink the board would be fairly effective, and is something I believe used to be part of the Lichess app.

chetanaik avatar Jun 03 '22 16:06 chetanaik

@jas14 is the migration to Capacitor 3 complete? This bug is still here one year later for Android 10+ (which I guess is now almost the entire Android user base?)

Since @mdz kindly volunteered, but was told to just wait a bit, it would be great to know if this is addressable now?

olagjo avatar Sep 24 '22 13:09 olagjo

Thanks for the reminder! Yes, we are now on Capacitor 3.

jas14 avatar Sep 24 '22 13:09 jas14

OK, I'll have a look

mdz avatar Sep 25 '22 02:09 mdz

Unfortunately, I've run short of time to devote to fixing this bug. I managed to get a functional dev environment set up, but wasn't able to reproduce the bug easily in the browser or emulator, which will slow me down a lot. Perhaps someone else with interest could step in.

mdz avatar Oct 12 '22 01:10 mdz