|
1 | 1 | // Definitions. |
2 | 2 | import { |
3 | | - AndroidFrame as AndroidFrameDefinition, BackstackEntry, NavigationEntry, |
| 3 | + AndroidFrame as AndroidFrameDefinition, BackstackEntry, NavigationEntry, |
4 | 4 | NavigationTransition, AndroidFragmentCallbacks, AndroidActivityCallbacks |
5 | 5 | } from "."; |
6 | 6 | import { Page } from "../page"; |
7 | 7 |
|
8 | 8 | // Types. |
9 | 9 | import * as application from "../../application"; |
10 | 10 | import { |
11 | | - FrameBase, NavigationContext, stack, goBack, View, Observable, topmost, |
| 11 | + FrameBase, NavigationContext, stack, goBack, View, Observable, topmost, |
12 | 12 | traceEnabled, traceWrite, traceCategories |
13 | 13 | } from "./frame-common"; |
14 | 14 |
|
@@ -65,8 +65,8 @@ export function reloadPage(): void { |
65 | 65 | return; |
66 | 66 | } |
67 | 67 | } |
68 | | - |
69 | | - frame.navigate(newEntry); |
| 68 | + |
| 69 | + frame.navigate(newEntry); |
70 | 70 | } |
71 | 71 | } |
72 | 72 |
|
@@ -185,7 +185,7 @@ export class Frame extends FrameBase { |
185 | 185 | if (!entry.recreated) { |
186 | 186 | clearEntry(entry); |
187 | 187 | } |
188 | | - |
| 188 | + |
189 | 189 | if (current && !current.recreated) { |
190 | 190 | clearEntry(current); |
191 | 191 | } |
@@ -317,7 +317,7 @@ export class Frame extends FrameBase { |
317 | 317 | if (removed.fragment) { |
318 | 318 | _clearEntry(removed); |
319 | 319 | } |
320 | | - |
| 320 | + |
321 | 321 | removed.fragment = null; |
322 | 322 | removed.viewSavedState = null; |
323 | 323 | } |
@@ -661,7 +661,7 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { |
661 | 661 | } |
662 | 662 |
|
663 | 663 | // Load page here even if root view is not loaded yet. |
664 | | - // Otherwiaw it will show as blank, |
| 664 | + // Otherwise it will show as blank, |
665 | 665 | // The case is Tab->Frame->Page activity recreated, fragments are |
666 | 666 | // created before Tab loads its items. |
667 | 667 | // TODO: addCheck if the fragment is visible so we don't load pages |
@@ -927,7 +927,14 @@ function setActivityContent(activity: android.app.Activity, savedInstanceState: |
927 | 927 | } |
928 | 928 |
|
929 | 929 | // Initialize native visual tree; |
930 | | - rootView._setupAsRootView(activity); |
| 930 | + if (shouldCreateRootFrame) { |
| 931 | + // Don't setup as styleScopeHost |
| 932 | + rootView._setupUI(activity); |
| 933 | + } else { |
| 934 | + // setup view as styleScopeHost |
| 935 | + rootView._setupAsRootView(activity); |
| 936 | + } |
| 937 | + |
931 | 938 | activity.setContentView(rootView.nativeViewProtected, new org.nativescript.widgets.CommonLayoutParams()); |
932 | 939 | } |
933 | 940 |
|
|
0 commit comments