Android - PullToRefresh Library used by gmail and others blocks my ListItem Swiping?

半腔热情 提交于 2019-12-11 03:15:48

问题


I am using Chris Banes PullToRefresh Library in my project: https://github.com/chrisbanes/ActionBar-PullToRefresh

Before that I used his old library: https://github.com/chrisbanes/Android-PullToRefresh

In my project I also copied and pasted parts of SwipeListView library made by 47deg: https://github.com/47deg/android-swipelistview

The problem I am facing is.. the SwipeListView (Swipe ListItem) worked great with the old PullToRegresh Library but when I had put the new library the ListItem swiping that I included in the application stopped working, I have read in here: Implementing Chris Banes's pull to refresh together with horizontal swipe on list view

That other people also facing the same problem, I also tried using the solution that some gave like:

postListView.getRefreshableView().setOnTouchListener(gestureListener);

Here's how my app implements the new PullTheRefresh (which works fine):

// Get View for which the user will scroll…
    mPullRefreshListView = (MySwipeList) findViewById(R.id.pull_refresh_list);

    // Create a PullToRefreshAttacher instance
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Add the Refreshable View and provide the refresh listener
    mPullToRefreshAttacher.addRefreshableView(mPullRefreshListView, this);

it seems like the new library blocks my OnTouch listener code of the ListViewItem of my app: My SwipeList-

public class MySwipeList extends ListView   {

int frontViewId;

public MySwipeListTouchListener swipeListener;

public MySwipeList(Context context, int frontViewId) {
    super(context);

    this.frontViewId = frontViewId;

    this.swipeListener = new MySwipeListTouchListener(this);

    super.setOnTouchListener(swipeListener);
    super.setOnScrollListener(swipeListener.makeScrollListener());
}

}

MySwipeListTouchListener (basically this)- https://github.com/47deg/android-swipelistview/blob/master/swipelistview/src/com/fortysevendeg/swipelistview/SwipeListViewTouchListener.java

Anyone have other suggestions on how can I fix my problem?

来源:https://stackoverflow.com/questions/18800874/android-pulltorefresh-library-used-by-gmail-and-others-blocks-my-listitem-swip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!