Understanding Android touch flow control

--

Managing Android touch flow control may not seems necessary until one needs it, then realize it is not as simple as just referring to the code. Hence having a heads up of what the flow looks like would be handy in time of need.

Give me some example where we need to manage touch flow…

Imagine you have ScrollView within a ScrollView (and within another ScrollView) as show in GIF below. How do you think you could manage the touch control?

In case you like to get the code it is in https://github.com/elye/demo_android_scrollview_in_scrollview

Same applies for RecyclerView in a RecyclerView or ViewPager in ViewPager or a mixture of them. How could one control the flows as needed?

Well, to do that, instead of search for code to copy-&-paste, lets understand the touch flow control.

The Touch Control Flow

The Basic Flow

Let’s start with the basic flow when a touch happens. It start from the Activity, flow down to the layout (from the parent to the child layouts), and then to each…

--

--