Android Kotlin child onClick blocks parent OnTouch
<p>I have this layout hierarchy:</p>

<pre><code>&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;com.xxxxxx.Widget
        android:id="@+id/widget1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/&gt;

    &lt;com.xxxxxx.Widget
        android:id="@+id/widget2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/&gt;
    &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>I have touch Events for the Parent LinearLayout like this:</p>

<pre><code>parent.setOnTouchListener(myCustomTouchParent)

    class MyCustomTouchParent(ctx: Context): View.OnTouchListener {

        private var isScrollingDown = false
        private var isScrollingUp = false
        private val myGestureDetected = GestureDetector(ctx, MyGestureListener())

        var onRecyclerViewMovingDown: (() -&gt; Unit)? = null

        override fun onTouch(p0: View?, e: MotionEvent): Boolean {
            myGestureDetected.onTouchEvent(e)

            when(e.action){
                MotionEvent.ACTION_UP -&gt; {
                    if (isScrollingDown) {
                        onRecyclerViewMovingDown?.invoke()
                    }
                }

                MotionEvent.ACTION_DOWN -&gt; {
                    Log.i("TAg", "Action Down")
                    isScrollingDown = false
                    isScrollingUp = false

                }
            }
            return true
        }

        inner class MyGestureListener: GestureDetector.SimpleOnGestureListener() {
            override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
                if(e2.y - e1.y &gt; 0){
                    isScrollingUp = true
                } else if(e2.y - e1.y &lt; 0){
                    isScrollingDown = true
                }
                return super.onScroll(e1, e2, distanceX, distanceY)
            }


        }
    }
</code></pre>

<p>Basically, this will detect a 'Scroll Up' event on the parent, and will perform some animations. The problem is, as soon as I set a click listener for widget1 and widget2, the touch event of the parent is no longer working. Is there any workaround for this?</p>