daimajia / daimajia/AndroidSwipeLayout

ListView item cannot drag

Open
#400 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.3k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

I use example demo of ListViewAdapter. after play around, I found out that I cannot drag to open but swipe does. While closing can drag. Is it possible for ListView to drag for opening BottomView.

```
@Override
public View generateView(int position, ViewGroup parent) {
View v = LayoutInflater.from(mContext).inflate(R.layout.listview_item, null);
SwipeLayout swipeLayout = (SwipeLayout)v.findViewById(getSwipeLayoutResourceId(position));
swipeLayout.setShowMode(SwipeLayout.ShowMode.PullOut);
swipeLayout.setDrag(SwipeLayout.DragEdge.Right, R.id.back);

// swipeLayout.addSwipeListener(new SimpleSwipeListener() {
// @Override
// public void onOpen(SwipeLayout layout) {
// YoYo.with(Techniques.Tada).duration(500).delay(100).playOn(layout.findViewById(R.id.trash));
// }
// });
// swipeLayout.setOnDoubleClickListener(new SwipeLayout.DoubleClickListener() {
// @Override
// public void onDoubleClick(SwipeLayout layout, boolean surface) {
// Toast.makeText(mContext, "DoubleClick", Toast.LENGTH_SHORT).show();
// }
// });

v.findViewById(R.id.delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(mContext, "click delete", Toast.LENGTH_SHORT).show();
}
});

return v;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.