Skip to content

Objects on scrollview intercept touch events, pull to refresh doesn't work in that case #1

@gerryhigh

Description

@gerryhigh

I'm testing this out on a scenario where the scrollview has variable sized content and thus may not always scroll on its own. In that scenario if you have say an TextView with a click handler it is intercepting the touch event and the pull to refresh feature doesn't work.

Try this:

<pulltorefresharp.android.views.ViewWrapper xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pullToRefresharpWrapper="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<pulltorefresharp.android.widget.ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="@color/content_background">



</pulltorefresharp.android.widget.ScrollView>
</pulltorefresharp.android.views.ViewWrapper>

And then in code, bind to the textview like so:
var tv = view.FindViewById(Resource.Id.textview);
tv.Click += (object sender, EventArgs e) => {
Console.WriteLine("clicked on ...");
};

The PTR scrollview widget's OnTouchEvent never gets called. I'm going to do some more testing to see how to fix this but wanted to post it in case you've already tested this scenario.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions