Skip to content

Commit f08b491

Browse files
ADjenkovmanoldonev
authored andcommitted
fix(android-transition): exit transition not executed after app suspend resume (#7402)
1 parent 6f439cb commit f08b491

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tns-core-modules/ui/frame/fragment.transitions.android.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// <reference path="transition-definitions.android.d.ts"/>
22

33
// Definitions.
4+
import { NavigationType } from "./frame-common";
45
import { NavigationTransition, BackstackEntry } from "../frame";
56
import { AnimationType } from "./fragment.transitions.types";
67

@@ -175,7 +176,7 @@ export function _setAndroidFragmentTransitions(
175176
// we do not use Android backstack so setting popEnter / popExit is meaningless (3rd and 4th optional args)
176177
fragmentTransaction.setCustomAnimations(AnimationType.enterFakeResourceId, AnimationType.exitFakeResourceId);
177178
}
178-
179+
179180
setupAllAnimation(newEntry, transition);
180181
if (currentFragmentNeedsDifferentAnimation) {
181182
setupExitAndPopEnterAnimation(currentEntry, transition);
@@ -733,12 +734,13 @@ function transitionOrAnimationCompleted(entry: ExpandedEntry): void {
733734
completedEntries.delete(frameId);
734735
waitingQueue.delete(frameId);
735736

737+
const navigationContext = frame._executingContext || { navigationType: NavigationType.back };
736738
let current = frame.isCurrent(entry) ? previousCompletedAnimationEntry : entry;
737739
current = current || entry;
738740
// Will be null if Frame is shown modally...
739741
// 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));
742744
}
743745
} else {
744746
completedEntries.set(frameId, entry);

0 commit comments

Comments
 (0)