mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix-next: handle action bar safe area nesting (#6455)
This commit is contained in:
@@ -35,6 +35,7 @@ export function pageLoaded(args: EventData) {
|
||||
examples.set("webview", "web-view/main-page");
|
||||
examples.set("progress-bar", "progress-bar/main-page");
|
||||
examples.set("date-picker", "date-picker/date-picker");
|
||||
examples.set("nested-frames", "nested-frames/main-page");
|
||||
page.bindingContext = new MainPageViewModel(wrapLayout, examples);
|
||||
|
||||
const parent = page.getViewById("parentLayout");
|
||||
|
||||
10
apps/app/ui-tests-app/nested-frames/full-screen-n-n.xml
Normal file
10
apps/app/ui-tests-app/nested-frames/full-screen-n-n.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout backgroundColor="blue">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
10
apps/app/ui-tests-app/nested-frames/full-screen-n-y.xml
Normal file
10
apps/app/ui-tests-app/nested-frames/full-screen-n-y.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout backgroundColor="blue">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
10
apps/app/ui-tests-app/nested-frames/full-screen-y-n.xml
Normal file
10
apps/app/ui-tests-app/nested-frames/full-screen-y-n.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout backgroundColor="blue">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
10
apps/app/ui-tests-app/nested-frames/full-screen-y-y.xml
Normal file
10
apps/app/ui-tests-app/nested-frames/full-screen-y-y.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout backgroundColor="blue">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
28
apps/app/ui-tests-app/nested-frames/main-page.ts
Normal file
28
apps/app/ui-tests-app/nested-frames/main-page.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { SubMainPageViewModel } from "../sub-main-page-view-model";
|
||||
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
const wrapLayout = <WrapLayout>page.getViewById("wrapLayoutWithExamples");
|
||||
page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples());
|
||||
}
|
||||
|
||||
export function loadExamples() {
|
||||
const examples = new Map<string, string>();
|
||||
examples.set("full-screen-n-n", "nested-frames/full-screen-n-n");
|
||||
examples.set("full-screen-n-y", "nested-frames/full-screen-n-y");
|
||||
examples.set("full-screen-y-n", "nested-frames/full-screen-y-n");
|
||||
examples.set("full-screen-y-y", "nested-frames/full-screen-y-y");
|
||||
examples.set("mid-screen-n-n", "nested-frames/mid-screen-n-n");
|
||||
examples.set("mid-screen-n-y", "nested-frames/mid-screen-n-y");
|
||||
examples.set("mid-screen-y-n", "nested-frames/mid-screen-y-n");
|
||||
examples.set("mid-screen-y-y", "nested-frames/mid-screen-y-y");
|
||||
examples.set("tab-y-y", "nested-frames/tab-y-y");
|
||||
examples.set("tab-n-y", "nested-frames/tab-n-y");
|
||||
examples.set("tab-y-n", "nested-frames/tab-y-n");
|
||||
examples.set("tab-n-n", "nested-frames/tab-n-n");
|
||||
|
||||
return examples;
|
||||
}
|
||||
6
apps/app/ui-tests-app/nested-frames/main-page.xml
Normal file
6
apps/app/ui-tests-app/nested-frames/main-page.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Page loaded="pageLoaded">
|
||||
<ScrollView orientation="vertical" row="1">
|
||||
<WrapLayout id="wrapLayoutWithExamples"/>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
12
apps/app/ui-tests-app/nested-frames/mid-screen-n-n.xml
Normal file
12
apps/app/ui-tests-app/nested-frames/mid-screen-n-n.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout rows="200, *" backgroundColor="blue">
|
||||
<GridLayout row="1">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
12
apps/app/ui-tests-app/nested-frames/mid-screen-n-y.xml
Normal file
12
apps/app/ui-tests-app/nested-frames/mid-screen-n-y.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout rows="200, *" backgroundColor="blue">
|
||||
<GridLayout row="1">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
12
apps/app/ui-tests-app/nested-frames/mid-screen-y-n.xml
Normal file
12
apps/app/ui-tests-app/nested-frames/mid-screen-y-n.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout rows="200, *" backgroundColor="blue">
|
||||
<GridLayout row="1">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
12
apps/app/ui-tests-app/nested-frames/mid-screen-y-y.xml
Normal file
12
apps/app/ui-tests-app/nested-frames/mid-screen-y-y.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout rows="200, *" backgroundColor="blue">
|
||||
<GridLayout row="1">
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
13
apps/app/ui-tests-app/nested-frames/nested-page.xml
Normal file
13
apps/app/ui-tests-app/nested-frames/nested-page.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Nested page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<GridLayout rows="*, *" columns="*, *" backgroundColor="red">
|
||||
<Label row="0" col="0" text="test" backgroundColor="gold"></Label>
|
||||
<Label row="0" col="1" text="test" backgroundColor="green"></Label>
|
||||
<Label row="1" col="0" text="test" backgroundColor="yellow"></Label>
|
||||
<Label row="1" col="1" text="test" backgroundColor="purple"></Label>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
14
apps/app/ui-tests-app/nested-frames/tab-n-n.xml
Normal file
14
apps/app/ui-tests-app/nested-frames/tab-n-n.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<TabView selectedTabTextColor="green">
|
||||
<TabViewItem title="First">
|
||||
<GridLayout>
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</Page>
|
||||
14
apps/app/ui-tests-app/nested-frames/tab-n-y.xml
Normal file
14
apps/app/ui-tests-app/nested-frames/tab-n-y.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<TabView selectedTabTextColor="green">
|
||||
<TabViewItem title="First">
|
||||
<GridLayout>
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</Page>
|
||||
14
apps/app/ui-tests-app/nested-frames/tab-y-n.xml
Normal file
14
apps/app/ui-tests-app/nested-frames/tab-y-n.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<TabView selectedTabTextColor="green">
|
||||
<TabViewItem title="First">
|
||||
<GridLayout>
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="never"></Frame>
|
||||
</GridLayout>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</Page>
|
||||
14
apps/app/ui-tests-app/nested-frames/tab-y-y.xml
Normal file
14
apps/app/ui-tests-app/nested-frames/tab-y-y.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
|
||||
|
||||
<ActionBar>
|
||||
<Label text="Parent page"></Label>
|
||||
</ActionBar>
|
||||
|
||||
<TabView selectedTabTextColor="green">
|
||||
<TabViewItem title="First">
|
||||
<GridLayout>
|
||||
<Frame id="nestedFrame" defaultPage="ui-tests-app/nested-frames/nested-page" actionBarVisibility="always"></Frame>
|
||||
</GridLayout>
|
||||
</TabViewItem>
|
||||
</TabView>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user