FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix-next: handle fragments removed after save state · NativeScript/NativeScript@f5037c0 · GitHub

Commit f5037c0

Browse files
committed
fix-next: handle fragments removed after save state
1 parent 8241e4b commit f5037c0

12 files changed

Lines changed: 279 additions & 220 deletions

File tree

‎apps/app/ui-tests-app/app-root.ts‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎apps/app/ui-tests-app/app-root.xml‎

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1 @@
1-
<TabView selectedTabTextColor="green" androidOffscreenTabLimit="1" androidTabsPosition="top">
2-
<TabView.items>
3-
<TabViewItem title="First">
4-
<TabViewItem.view>
5-
6-
<Frame defaultPage="ui-tests-app/page1" />
7-
</TabViewItem.view>
8-
</TabViewItem>
9-
10-
<TabViewItem title="Second">
11-
<TabViewItem.view>
12-
13-
<Frame defaultPage="ui-tests-app/page2" />
14-
15-
</TabViewItem.view>
16-
</TabViewItem>
17-
18-
<TabViewItem title="First1">
19-
<TabViewItem.view>
20-
21-
<Frame defaultPage="ui-tests-app/page1" />
22-
23-
</TabViewItem.view>
24-
</TabViewItem>
25-
26-
<TabViewItem title="Second1">
27-
<TabViewItem.view>
28-
29-
<Frame defaultPage="ui-tests-app/page2" />
30-
31-
</TabViewItem.view>
32-
</TabViewItem>
33-
</TabView.items>
34-
</TabView>
1+
<Frame defaultPage="ui-tests-app/main-page" />

‎apps/app/ui-tests-app/app.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
import * as application from "tns-core-modules/application";
44
import * as trace from "tns-core-modules/trace";
5-
// trace.addCategories(trace.categories.NativeLifecycle);
6-
// trace.addCategories(trace.categories.Navigation);
7-
// trace.addCategories(trace.categories.Transition);
8-
trace.addCategories(trace.categories.Debug);
5+
trace.addCategories(trace.categories.NativeLifecycle);
6+
trace.addCategories(trace.categories.Navigation);
7+
trace.addCategories(trace.categories.Transition);
98

109
trace.enable();
1110

@@ -84,6 +83,6 @@ application.on(application.uncaughtErrorEvent, function(args: application.Unhand
8483

8584
application.setCssFileName("ui-tests-app/app.css");
8685

87-
// application.start({ moduleName: "ui-tests-app/main-page" });
88-
application.run({ moduleName: "ui-tests-app/app-root" });
86+
application.start({ moduleName: "ui-tests-app/main-page" });
87+
// application.run({ moduleName: "ui-tests-app/app-root" });
8988
// application.run();

‎apps/app/ui-tests-app/page1.xml‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎apps/app/ui-tests-app/page2.xml‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎apps/app/ui-tests-app/test-page.ts‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎tests/app/ui/tab-view/tab-view-navigation-tests.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as TKUnit from "../../TKUnit";
22
import * as helper from "../helper";
3+
import { isIOS, isAndroid } from "tns-core-modules/platform";
34
import { Label } from "tns-core-modules/ui/label";
45
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
56
import * as frameModule from "tns-core-modules/ui/frame";
@@ -201,8 +202,15 @@ export function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack() {
201202

202203
topFrame.currentPage.id = null;
203204

204-
TKUnit.arrayAssert(loadedEventsCount, [2, 0]);
205-
TKUnit.arrayAssert(unloadedEventsCount, [1, 0]);
205+
if (isIOS) {
206+
TKUnit.arrayAssert(loadedEventsCount, [2, 0]);
207+
TKUnit.arrayAssert(unloadedEventsCount, [1, 0]);
208+
}
209+
210+
if (isAndroid) {
211+
TKUnit.arrayAssert(loadedEventsCount, [2, 2]);
212+
TKUnit.arrayAssert(unloadedEventsCount, [1, 1]);
213+
}
206214
}
207215

208216
function _clickTheFirstButtonInTheListViewNatively(tabView: TabView) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL