Home:ALL Converter>How to disable touch events for the top view so that it lets touch events to pass through to the underlying view?

How to disable touch events for the top view so that it lets touch events to pass through to the underlying view?

Ask Time:2018-04-20T13:26:25         Author:Umair

Json Formatter

I am an android beginner and have looked for a solution to this problem, but apparently couldn't find it I have a Google Map fragment and a canvas taking up the same space in XML. A Circle is drawn on the canvas. But with the current setup, canvas doesn't let touch events pass through to the map. I want a transparent canvas with a circle on top of Map view in a way so that touch events are disabled for canvas but map receives touch events. Please note that using Google Map's Circle class as an alternative to canvas is not an option. Here is my XML. [enter image description here][1]

<FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
                    <fragment 
                  xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/map"
                        android:name="com.google.android.gms.maps.MapFragment"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"

                        />

                    <com.example.murtaza.bettertracker.ui.CircleCanvasClass
                        android:id="@+id/circleView"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="visible" />
            />
</FrameLayout>

Author:Umair,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49934566/how-to-disable-touch-events-for-the-top-view-so-that-it-lets-touch-events-to-pas
yy