SwipeBackLayout侧滑关闭页面 适配AndroidX
implementation 'com.github.ZLYang110:SwipeBack:1.0.1'
public class MainActivity extends SwipeBackActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
...
}
}
switch (checkedId){
case R.id.mode_left:
mSwipeBackHelper.getSwipeBackLayout().setSwipeBackDirection(SwipeBackDirection.FROM_LEFT);
break;
case R.id.mode_right:
mSwipeBackHelper.getSwipeBackLayout().setSwipeBackDirection(SwipeBackDirection.FROM_RIGHT);
break;
case R.id.mode_top:
mSwipeBackHelper.getSwipeBackLayout().setSwipeBackDirection(SwipeBackDirection.FROM_TOP);
break;
case R.id.mode_bottom:
mSwipeBackHelper.getSwipeBackLayout().setSwipeBackDirection(SwipeBackDirection.FROM_BOTTOM);
break;
}