From 27773e96a6558fb14e63fb3ef8a83d216591faec Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Thu, 28 Sep 2017 09:19:06 +0300 Subject: [PATCH] Initial transitions are ingored on android (as they are on ios) because on API 21+ Transition class requires at least one layout pass before transitions are executed. If we don't ignore it our transition handlers won't execute and frame navigation won't execute because it thinks there is a pending navigation. (#4896) Fix https://github.com/NativeScript/NativeScript/issues/4895 --- tns-core-modules/ui/frame/frame.android.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/frame/frame.android.ts b/tns-core-modules/ui/frame/frame.android.ts index 65f93570a..cd3255c85 100644 --- a/tns-core-modules/ui/frame/frame.android.ts +++ b/tns-core-modules/ui/frame/frame.android.ts @@ -140,7 +140,11 @@ export class Frame extends FrameBase { const fragmentTransaction = manager.beginTransaction(); const animated = this._getIsAnimatedNavigation(backstackEntry.entry); - const navigationTransition = this._getNavigationTransition(backstackEntry.entry); + // NOTE: Don't use transition for the initial nagivation (same as on iOS) + //. On API 21+ transition won't be triggered unless there was at least one + // layout pass so we will wait forever for transitionCompleted handler... + // https://github.com/NativeScript/NativeScript/issues/4895 + const navigationTransition = this._currentEntry ? this._getNavigationTransition(backstackEntry.entry) : null; _setAndroidFragmentTransitions(animated, navigationTransition, currentFragment, newFragment, fragmentTransaction, manager); if (currentFragment) {