Skip to content

Commit 352f425

Browse files
committed
Update swipe-back Demo
1 parent 317daee commit 352f425

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

demo/src/main/java/me/yokeyword/sample/flow/SwipeBackSampleActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ protected void onCreate(Bundle savedInstanceState) {
2626
getSwipeBackLayout().setEdgeOrientation(SwipeBackLayout.EDGE_ALL);
2727
}
2828

29+
/**
30+
* 限制SwipeBack的条件,默认栈内Fragment数 <= 1时 , 优先滑动退出Activity , 而不是Fragment
31+
*
32+
* @return true: Activity可以滑动退出, 并且总是优先; false: Activity不允许滑动退出
33+
*/
34+
@Override
35+
public boolean swipeBackPriority() {
36+
return super.swipeBackPriority();
37+
}
38+
2939
public FragmentAnimator onCreateFragmentAnimator() {
3040
return new DefaultHorizontalAnimator();
3141
}

0 commit comments

Comments
 (0)