Fire OnClickListener on Views inside a custom ScrollView
<p>This is a follow-up to <a href="http://stackoverflow.com/questions/16018084/onclicklistener-on-views-inside-a-custom-scrollview">this</a> question. </p>

<p>I'm havin a horizontal ScrollView inside a ViewPager. To prevent the ViewPager to be scrolled when the end of the ScrollView is reached I use this class as per hint on SO: </p>

<pre><code>public class CustomScrollView extends HorizontalScrollView {

public CustomScrollView(Context p_context, AttributeSet p_attrs) {
    super(p_context, p_attrs);
}

@Override

public boolean onInterceptTouchEvent(MotionEvent p_event) {

    return true;
}

@Override
public boolean onTouchEvent(MotionEvent p_event) {


if (p_event.getAction() == MotionEvent.ACTION_MOVE
        &amp;&amp; getParent() != null) {
    getParent().requestDisallowInterceptTouchEvent(true);
}

return super.onTouchEvent(p_event);
}

}
</code></pre>

<p>The <code>onInterCeptTouchEvent</code> seems to consume any click to that <code>View</code> and everything inside it. When I put Views into that <code>ScrollView</code>, their <code>OnClickListeners</code> won't be called.</p>

<p>When I let <code>onInterceptTouchEvent</code> return false, the <code>OnClickListeners</code> are called, but the <code>ScrollView</code> can't be scrolled.</p>

<p>How can I put clickable Views inside that ScrollView?</p>

<p>I followed the proposed answer "call <code>onTouchEvent</code> inside the implementation of <code>onInterceptTouchEvent</code> and then <code>return false</code>."</p>

<p>Now the <code>onClickListener</code> of the <code>View</code> inside the <code>ScrollView</code> is called, but not only on clicks but on pretty much any gesture event on the View, including scrolling the <code>ScrollView</code>. Does anybody have another suggestion?</p>
