From 0abfb1493c3b54838084f5c403c3e0f8433ed808 Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Mon, 11 Dec 2017 11:08:25 +0200 Subject: [PATCH] Fix crash on API17 and API21-25 --- tests/app/ui/view/view-tests-common.ts | 1 - tns-core-modules/ui/frame/fragment.transitions.android.ts | 5 +++-- tns-core-modules/ui/tab-view/tab-view.android.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/app/ui/view/view-tests-common.ts b/tests/app/ui/view/view-tests-common.ts index 759b3c38c..fff082804 100644 --- a/tests/app/ui/view/view-tests-common.ts +++ b/tests/app/ui/view/view-tests-common.ts @@ -280,7 +280,6 @@ const customShortHandProperty = new ShorthandProperty({ name: "customShortHand", cssName: "custom-short-hand", converter(value: string): [CssProperty, any][] { - console.log("Convert: " + value); const values = value.split(","); return [ [customCssAProperty, values[0]], diff --git a/tns-core-modules/ui/frame/fragment.transitions.android.ts b/tns-core-modules/ui/frame/fragment.transitions.android.ts index c7e9d59ea..25651c48d 100644 --- a/tns-core-modules/ui/frame/fragment.transitions.android.ts +++ b/tns-core-modules/ui/frame/fragment.transitions.android.ts @@ -204,10 +204,11 @@ export function _onFragmentCreateAnimator(entry: ExpandedEntry, fragment: androi if (!animator && sdkVersion() >= 21) { const view = fragment.getView(); - const parent = view.getParent(); + const jsParent = entry.resolvedPage.parent; + const parent = view.getParent() || (jsParent && jsParent.nativeViewProtected); const animatedEntries = _getAnimatedEntries(entry.frameId); if (!animatedEntries || !animatedEntries.has(entry)) { - if (!(parent).isLaidOut()) { + if (parent && !(parent).isLaidOut()) { animator = enter ? entry.defaultEnterAnimator : entry.defaultExitAnimator; } } diff --git a/tns-core-modules/ui/tab-view/tab-view.android.ts b/tns-core-modules/ui/tab-view/tab-view.android.ts index 8660b3b2c..ab5c4ae3b 100644 --- a/tns-core-modules/ui/tab-view/tab-view.android.ts +++ b/tns-core-modules/ui/tab-view/tab-view.android.ts @@ -185,6 +185,7 @@ function initializeNativeClasses() { (this.mCurTransaction).commitNowAllowingStateLoss(); } else { this.mCurTransaction.commitAllowingStateLoss(); + this.owner._getFragmentManager().executePendingTransactions(); } this.mCurTransaction = null;