Skip to content

Commit

Permalink
转场动画
Browse files Browse the repository at this point in the history
  • Loading branch information
weikaiyun committed Sep 12, 2020
1 parent d3ed6cf commit 3e6c7ce
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void run() {
ft.show((Fragment) preFragment);
ft.setMaxLifecycle((Fragment) preFragment, Lifecycle.State.RESUMED);
}
ft.commit();
supportCommit(fm, ft);
}
});
}
Expand Down Expand Up @@ -414,7 +414,7 @@ private Bundle getArguments(Fragment fragment) {
}

private void supportCommit(FragmentManager fm, FragmentTransaction transaction) {
transaction.commitAllowingStateLoss();
transaction.commitNowAllowingStateLoss();
}

private boolean handleLaunchMode(FragmentManager fm, ISupportFragment topFragment,
Expand Down Expand Up @@ -503,18 +503,15 @@ private void doPopTo(final String targetFragmentTag, boolean includeTargetFragme

ft.show(targetFragment);
ft.setMaxLifecycle(targetFragment, Lifecycle.State.RESUMED);
ft.commit();

FragmentationMagician.executePendingTransactions(fm);
supportCommit(fm, ft);
}

private void safePopTo(final FragmentManager fm, List<Fragment> willPopFragments) {
FragmentTransaction transaction = fm.beginTransaction();
FragmentTransaction ft = fm.beginTransaction();
for (Fragment fragment : willPopFragments) {
transaction.remove(fragment);
ft.remove(fragment);
}
transaction.commit();
FragmentationMagician.executePendingTransactions(fm);
supportCommit(fm, ft);
}

private static <T> void checkNotNull(T value) {
Expand Down

0 comments on commit 3e6c7ce

Please sign in to comment.