Bug 41867 - [Android] masterDetailPage.IsGestureEnabled = false not working on Android.
Summary: [Android] masterDetailPage.IsGestureEnabled = false not working on Android.
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Samantha Houts [MSFT]
Depends on:
Reported: 2016-06-15 20:16 UTC by Jon Goldberger [MSFT]
Modified: 2017-06-19 21:04 UTC (History)
11 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Test Project (61.29 KB, application/zip)
2016-06-15 20:16 UTC, Jon Goldberger [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 41867 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Jon Goldberger [MSFT] 2016-06-15 20:16:19 UTC
Created attachment 16346 [details]
Test Project

## Description

masterDetailPage.IsGestureEnabled = false not working on Android. More accurately, on a phone device with setting IsGestureEnabled to false allows the master page to be opened but not closed by a swipe gesture, however on a Tablet device you can still use the swipe gesture to open and close the master page when in Portrait. (Tablet in landscape locks the Master page open as expected.) All this works as expected on iOS. 

## Steps to reproduce

1. Open the attached test project (derived from Forms Gallery sample)

2. Launch to Android emulator or device in portrait orientation (Tested with Google emulator Nexus 10 image, Nexus 5 image, and physical Samsung Tablet.

3. Swipe to open Master page

Expected result: Master page will not open

Actual result: Master page does open

4. Swipe to close the Master page

Expected result: Master page will not close

Actual result: On Tablet, Master page will close, on Phone as expected. 

## Notes

I tested this with Forms and with the same results.

## Environment

=== Xamarin Studio Enterprise ===

Version 6.0 (build 5174)
Installation UUID: ceaba76c-db06-4fbd-b326-f69ea53c3e01
	Mono 4.4.0 (mono-4.4.0-branch-c7-baseline/5995f74) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 404000182

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: (Visual Studio Enterprise)
Android SDK: /Users/jongoldberger/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin Inspector ===

Hash: dc081aa
Branch: master
Build date: Tue Apr 26 23:07:44 UTC 2016

=== Apple Developer Tools ===

Xcode 7.3.1 (10188.1)
Build 7D1014

=== Xamarin.iOS ===

Version: (Visual Studio Enterprise)
Hash: 39ebb77
Branch: cycle7
Build date: 2016-06-01 21:23:15-0400

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise)

=== Build Information ===

Release ID: 600005174
Git revision: 694a75f040b7f2309bc43d4f78a3a6572ca898bf
Build date: 2016-06-01 17:28:08-04
Xamarin addins: 33f406fa2dcf214012c78cb846585f062b2e1d24
Build lane: monodevelop-lion-cycle7-baseline

=== Operating System ===

Mac OS X 10.11.5
Darwin Jons-MacBook-Pro.local 15.5.0 Darwin Kernel Version 15.5.0
    Tue Apr 19 18:36:36 PDT 2016
    root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Xamarin Inspector
Comment 6 Jon Goldberger [MSFT] 2017-06-19 19:43:32 UTC

I tried your solution in private comment 3 and indeed it works to stop the Master page from opening with a swipe gesture, but if I do the test you suggest than I can't open that Master page via the hambgurger icon either. IOW doing this:

>// For Android & Windows Phone, provide a way to get back to the master page.
>if (Device.RuntimePlatform != Device.iOS) {
>    TapGestureRecognizer tap = new TapGestureRecognizer ();
>    tap.Tapped += (sender, args) => {
>        if (IsGestureEnabled == true)
>            this.IsPresented = true;
>    };
>    detailPage.Content.BackgroundColor = Color.Transparent;
>    detailPage.Content.GestureRecognizers.Add (tap);

Makes it impossible to open the master page by swipe or by tapping the master menu (hamburger) icon. 

So how would one allow the hamburger menu icon to work to open the master page while only stopping the swipe gesture from opening and closing the menu page on Android? 

Also this is an issue of differing behavior. on iOS Setting IsGestureEnabled = false only stops the swipe gesture from opening and closing the master page, while the hamburger icon can still be used to open and close the master page. This would seem to be the desired result of setting IsGestureEnabled = false, i.e. disabling the swipe gesture but not the menu icon. 

Setting status to re-opened.