mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
fix(android-transition): exit transition not executed after app suspend resume (#7402)
This commit is contained in:

committed by
Manol Donev

parent
6f439cb819
commit
f08b491750
@ -1,6 +1,7 @@
|
|||||||
/// <reference path="transition-definitions.android.d.ts"/>
|
/// <reference path="transition-definitions.android.d.ts"/>
|
||||||
|
|
||||||
// Definitions.
|
// Definitions.
|
||||||
|
import { NavigationType } from "./frame-common";
|
||||||
import { NavigationTransition, BackstackEntry } from "../frame";
|
import { NavigationTransition, BackstackEntry } from "../frame";
|
||||||
import { AnimationType } from "./fragment.transitions.types";
|
import { AnimationType } from "./fragment.transitions.types";
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ export function _setAndroidFragmentTransitions(
|
|||||||
// we do not use Android backstack so setting popEnter / popExit is meaningless (3rd and 4th optional args)
|
// we do not use Android backstack so setting popEnter / popExit is meaningless (3rd and 4th optional args)
|
||||||
fragmentTransaction.setCustomAnimations(AnimationType.enterFakeResourceId, AnimationType.exitFakeResourceId);
|
fragmentTransaction.setCustomAnimations(AnimationType.enterFakeResourceId, AnimationType.exitFakeResourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
setupAllAnimation(newEntry, transition);
|
setupAllAnimation(newEntry, transition);
|
||||||
if (currentFragmentNeedsDifferentAnimation) {
|
if (currentFragmentNeedsDifferentAnimation) {
|
||||||
setupExitAndPopEnterAnimation(currentEntry, transition);
|
setupExitAndPopEnterAnimation(currentEntry, transition);
|
||||||
@ -733,12 +734,13 @@ function transitionOrAnimationCompleted(entry: ExpandedEntry): void {
|
|||||||
completedEntries.delete(frameId);
|
completedEntries.delete(frameId);
|
||||||
waitingQueue.delete(frameId);
|
waitingQueue.delete(frameId);
|
||||||
|
|
||||||
|
const navigationContext = frame._executingContext || { navigationType: NavigationType.back };
|
||||||
let current = frame.isCurrent(entry) ? previousCompletedAnimationEntry : entry;
|
let current = frame.isCurrent(entry) ? previousCompletedAnimationEntry : entry;
|
||||||
current = current || entry;
|
current = current || entry;
|
||||||
// Will be null if Frame is shown modally...
|
// Will be null if Frame is shown modally...
|
||||||
// transitionOrAnimationCompleted fires again (probably bug in android).
|
// transitionOrAnimationCompleted fires again (probably bug in android).
|
||||||
if (current && frame._executingContext) {
|
if (current) {
|
||||||
setTimeout(() => frame.setCurrent(current, frame._executingContext.navigationType));
|
setTimeout(() => frame.setCurrent(current, navigationContext.navigationType));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
completedEntries.set(frameId, entry);
|
completedEntries.set(frameId, entry);
|
||||||
|
Reference in New Issue
Block a user