Skip to content

Commit d949cc7

Browse files
Include example action-bar flat property (NativeScript#4618)
* Inlcude example for flat property * Update xml
1 parent 0a695b0 commit d949cc7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Label } from "tns-core-modules/ui/Label";
2+
import { Page } from "tns-core-modules/ui/Page";
3+
4+
export function onNavigateTo(args) {
5+
const actionBar = (<Page>args.object).actionBar;
6+
args.object.flatPropertyValue = <Label>args.object.getViewById("flatPropertyValue");
7+
actionBar.flat = true;
8+
args.object.flatPropertyValue.text = "Action bar flat property is set to: " + actionBar.flat;
9+
}
10+
11+
export function changeFlatPropertyValue(args) {
12+
const actionBar = (<Page>args.object.page).actionBar;
13+
actionBar.flat = !actionBar.flat;
14+
args.object.page.flatPropertyValue.text = "Action bar flat property is set to: " + actionBar.flat;
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Page navigatedTo="onNavigateTo" >
2+
<Page.actionBar>
3+
<ActionBar title="Flat property" />
4+
</Page.actionBar>
5+
<StackLayout>
6+
<Button margin="30" text="change flat property" tap="changeFlatPropertyValue"/>
7+
<Label id="flatPropertyValue" />
8+
</StackLayout>
9+
</Page>

apps/app/ui-tests-app/action-bar/main-page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function loadExamples() {
2121
examples.set("actTransparentBgCss", "action-bar/transparent-bg-css");
2222
examples.set("modalHiddenActBar", "action-bar/modal-test-hidden-action-bar");
2323
examples.set("modalShownActBar", "action-bar/modal-test-with-action-bar");
24+
examples.set("flat", "action-bar/flat");
2425

2526
return examples;
2627
}

0 commit comments

Comments
 (0)