Skip to content

Commit

Permalink
fix #949 #942 extraTransaction().setCustomAnimations() exitAnimatio…
Browse files Browse the repository at this point in the history
…n is not working
  • Loading branch information
YoKeyword committed Aug 14, 2018
1 parent b66a4eb commit e43ead1
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,23 @@ void pop(final FragmentManager fm) {
@Override
public void run() {
handleAfterSaveInStateTransactionException(fm, "pop()");
removeTopFragment(fm);
FragmentationMagician.popBackStackAllowingStateLoss(fm);
removeTopFragment(fm);
}
});
}

private void removeTopFragment(FragmentManager fm) {
ISupportFragment top = SupportHelper.getBackStackTopFragment(fm);
if (top != null) {
fm.beginTransaction()
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.remove((Fragment) top)
.commitAllowingStateLoss();
try { // Safe popBackStack()
ISupportFragment top = SupportHelper.getBackStackTopFragment(fm);
if (top != null) {
fm.beginTransaction()
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.remove((Fragment) top)
.commitAllowingStateLoss();
}
} catch (Exception ignored) {

}
}

Expand Down

0 comments on commit e43ead1

Please sign in to comment.