首先,activity的右滑返回:
2.写一个 BaseActivity 继承 SwipeBackActivity:
public class BaseActivity extends SwipeBackActivity {
private SwipeBackLayout mSwipeBackLayout;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSwipeBackLayout = getSwipeBackLayout();
//设置滑动方向,可设置EDGE_LEFT, EDGE_RIGHT, EDGE_ALL, EDGE_BOTTOM
mSwipeBackLayout.setEdgeTrackingEnabled(SwipeBackLayout.EDGE_LEFT);
//mSwipeBackLayout.setEdgeSize(200);//滑动删除的效果只能从边界滑动才有效果,如果要扩大touch的范围ÿ