Skip to content

Commit

Permalink
Fix issue with animations caused by primary navigation setting cancel…
Browse files Browse the repository at this point in the history
…ling animations in Fragment 1.7.0
  • Loading branch information
isaac-udy committed Apr 30, 2024
1 parent 258f762 commit 409e08b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ public class FragmentNavigationContainer internal constructor(
}
}
}
val activeFragmentAndInstruction =
toPresent.lastOrNull() ?: activePushed ?: return@commitNow
val activeFragmentAndInstruction = toPresent.lastOrNull()
?: activePushed
?: return@commitNow

val activeFragment = activeFragmentAndInstruction.fragment
setPrimaryNavigationFragment(activeFragment)
}
Expand All @@ -223,6 +225,7 @@ public class FragmentNavigationContainer internal constructor(
fragmentManager.findFragmentByTag(it.instructionId)
}
?.let { primaryFragment ->
if (fragmentManager.primaryNavigationFragment != primaryFragment)
fragmentManager.commitNow {
setPrimaryNavigationFragment(primaryFragment)
}
Expand Down

0 comments on commit 409e08b

Please sign in to comment.