|
1 | 1 | /// <reference path="transition-definitions.android.d.ts"/> |
2 | 2 |
|
3 | 3 | // Definitions. |
| 4 | +import { NavigationType } from "./frame-common"; |
4 | 5 | import { NavigationTransition, BackstackEntry } from "../frame"; |
5 | 6 | import { AnimationType } from "./fragment.transitions.types"; |
6 | 7 |
|
@@ -175,7 +176,7 @@ export function _setAndroidFragmentTransitions( |
175 | 176 | // we do not use Android backstack so setting popEnter / popExit is meaningless (3rd and 4th optional args) |
176 | 177 | fragmentTransaction.setCustomAnimations(AnimationType.enterFakeResourceId, AnimationType.exitFakeResourceId); |
177 | 178 | } |
178 | | - |
| 179 | + |
179 | 180 | setupAllAnimation(newEntry, transition); |
180 | 181 | if (currentFragmentNeedsDifferentAnimation) { |
181 | 182 | setupExitAndPopEnterAnimation(currentEntry, transition); |
@@ -733,12 +734,13 @@ function transitionOrAnimationCompleted(entry: ExpandedEntry): void { |
733 | 734 | completedEntries.delete(frameId); |
734 | 735 | waitingQueue.delete(frameId); |
735 | 736 |
|
| 737 | + const navigationContext = frame._executingContext || { navigationType: NavigationType.back }; |
736 | 738 | let current = frame.isCurrent(entry) ? previousCompletedAnimationEntry : entry; |
737 | 739 | current = current || entry; |
738 | 740 | // Will be null if Frame is shown modally... |
739 | 741 | // transitionOrAnimationCompleted fires again (probably bug in android). |
740 | | - if (current && frame._executingContext) { |
741 | | - setTimeout(() => frame.setCurrent(current, frame._executingContext.navigationType)); |
| 742 | + if (current) { |
| 743 | + setTimeout(() => frame.setCurrent(current, navigationContext.navigationType)); |
742 | 744 | } |
743 | 745 | } else { |
744 | 746 | completedEntries.set(frameId, entry); |
|
0 commit comments