Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing Chris Banes's pull to refresh together with horizontal swipe on list view
    primarykey
    data
    text
    <p>I have implemented (from here- <a href="https://stackoverflow.com/a/5174757/637755">horizontal swipe on listview</a>) swipe gesture to mark-unmark items in a listview. I used Johan Nilsson's <a href="https://github.com/johannilsson/android-pulltorefresh" rel="nofollow noreferrer">pull to refresh</a> implementation to refresh items in the listview. The pull to refresh feature showed some abrupt behaviour-</p> <ul> <li>sometimes showing "Tap to Refresh"</li> <li>sometimes not hiding completely </li> <li>sometimes not changing from "Pull to refresh" to "Release..."</li> </ul> <p>I have now switched to Chris Banes' <a href="http://www.senab.co.uk/2011/11/29/new-pull-to-refresh-library/" rel="nofollow noreferrer">implementation</a>. The "pull to refresh" feature now works perfectly, but the "swipe" feature has stopped working. "Swipe" works perfectly otherwise.</p> <pre><code> final GestureDetector gestureDetector = new GestureDetector( new MyGestureDetector()); View.OnTouchListener gestureListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { return gestureDetector.onTouchEvent(event); } }; postListView.setOnTouchListener(gestureListener); </code></pre> <p>postListView is <code>PullToRefreshListView postListView = (PullToRefreshListView) linearLayout.findViewById(R.id.post_list);</code></p> <p>I guess it's not working because even Chris' implementation makes use of-</p> <pre><code> public boolean onTouch(View v, MotionEvent event) { //something over here } </code></pre> <p>Now, how do I use it at both place without any conflict? I need to detect the gestures on listview's rows as well as listen to pull in listview.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload