问题
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