Bug 59506 - InputTransparent on Android not applying to children
Summary: InputTransparent on Android not applying to children
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-15 00:59 UTC by Matthew Percy
Modified: 2018-01-19 18:27 UTC (History)
4 users (show)

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


Attachments
Test project (6.06 MB, application/x-7z-compressed)
2017-09-15 00:59 UTC, Matthew Percy
Details


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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Matthew Percy 2017-09-15 00:59:28 UTC
Created attachment 24760 [details]
Test project

Not sure if this is in any way related to the following bugs: 
https://bugzilla.xamarin.com/show_bug.cgi?id=25943
https://bugzilla.xamarin.com/show_bug.cgi?id=35749

It seems on Android, InputTransparent="true" isn't preventing TapGestureRecognizer Tapped events on child views/layouts. I've attached a sample project that shows the behaviour.

InputTransparent seems to work as expected in iOS.

From the sample layout code:
<AbsoluteLayout>
            <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Blue">
                <StackLayout HeightRequest="150" HorizontalOptions="FillAndExpand" VerticalOptions="Fill" BackgroundColor="Yellow">
                    <StackLayout.GestureRecognizers>
                        <TapGestureRecognizer Tapped="TouchUnder1"/>
                    </StackLayout.GestureRecognizers>
                </StackLayout>
                <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer Tapped="TouchUnder2"/>
                </StackLayout.GestureRecognizers>
            </StackLayout>
            <StackLayout AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" InputTransparent="True" BackgroundColor="Red" >
                <StackLayout HeightRequest="150" HorizontalOptions="FillAndExpand" VerticalOptions="Fill" BackgroundColor="Aqua">
                    <StackLayout.GestureRecognizers>
                        <TapGestureRecognizer Tapped="AboveTouched1"/>
                    </StackLayout.GestureRecognizers>
                </StackLayout>
                <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer Tapped="AboveTouched2"/>
                </StackLayout.GestureRecognizers>
            </StackLayout>
        </AbsoluteLayout>

On Android, tapping the top 150dp results in AboveTouched1 being called, and the lower part of the layout results in TouchUnder2 being called.

On iOS, tapping the top 150dp results in TouchUnder1 being called, and the lower part of the layout results in TouchUnder2 being called (as expected).

Please let me know if you need any additional information, happy to provide it.
Thanks
Comment 1 Paul DiPietro [MSFT] 2017-09-15 02:44:09 UTC
Also apparent on 2.4.0-pre2; I'll set this to confirmed until further investigation is done to determine if the issue is related to the one(s) mentioned.
Comment 2 E.Z. Hart [MSFT] 2018-01-19 18:27:18 UTC
This was fixed in 2.5.