Skip to content

Commit 0a1aad2

Browse files
committed
Use default NavOptions constructor to clear animations
To navigate without animations, the value for arguments of type @AnimatorRes should be -1.
1 parent f5a5cff commit 0a1aad2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/org/lsposed/manager/ui/fragment/BaseFragment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public NavController getNavController() {
5656
public boolean safeNavigate(@IdRes int resId) {
5757
try {
5858
if (!AccessibilityUtils.isAnimationEnabled(requireContext().getContentResolver())) {
59-
var animationOptions = new NavOptions.Builder().setEnterAnim(0).setExitAnim(0).build();
60-
getNavController().navigate(resId, animationOptions);
59+
var clearedNavOptions = new NavOptions.Builder().build();
60+
getNavController().navigate(resId, clearedNavOptions);
6161
} else {
6262
getNavController().navigate(resId);
6363
}
@@ -70,8 +70,8 @@ public boolean safeNavigate(@IdRes int resId) {
7070
public boolean safeNavigate(NavDirections direction) {
7171
try {
7272
if (!AccessibilityUtils.isAnimationEnabled(requireContext().getContentResolver())) {
73-
var animationOptions = new NavOptions.Builder().setEnterAnim(0).setExitAnim(0).build();
74-
getNavController().navigate(direction, animationOptions);
73+
var clearedNavOptions = new NavOptions.Builder().build();
74+
getNavController().navigate(direction, clearedNavOptions);
7575
} else {
7676
getNavController().navigate(direction);
7777
}

0 commit comments

Comments
 (0)